Re: reg C API from MySQL

2003-12-16 Thread P Arunachalam
Hello Patrick!

I am trying to connect COBOL to the MySQL Database. I
have used the C API to establish the conection to
MySQL. You have quoted that library file
mysqlclient.lib is enough.

But when I try to test the Connecton using VC++ editor
by writing a simpe C Program, the linking of
libmysql.lib only produce successdul connection.
i.e., mysqlclient.lib not required here.

But When I try to Link those two files into the Linker
for my COBOL application it wouldn't recognize the
methods inside the Libraray file (i.e, mysql_init,
mysql_real_connect, mysql_error...) and shows linker
errors. Is there any other Library files required

the platform I have used is
Windows 2k
CA REALIA II Workbench 3.0.55
CA REALIA COBOL Compiler 6.0.45
Microsoft 32 Bit incremental compiler 6.00.8168

can you please suggest me... Is there any other
library files need to be inluded...

regards,
Arun.

 --- Patrick Sherrill [EMAIL PROTECTED] wrote: 
Statically linking using C API only you will need 
 mysqlclient.lib
 
 For odbc interface you'll need to make odbc calls in
 your code and use
 myodbc.dll (Install myodbc on the client).
 
 You can mix calls, but why would you.  I have found
 the C API to be the best
 solution for us.  We statically link for dll
 avoidance. You can get the
 source or pre-built client libraries from the MySQL
 web site.
 
 I hope this helps.
 
 Pat...
 
 [EMAIL PROTECTED]
 CocoNet Corporation
 SW Florida's First ISP
 825 SE 47th Terrace
 Cape Coral, FL 33904
 
 
 
 
 
 - Original Message - 
 From: P Arunachalam [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, December 11, 2003 4:31 AM
 Subject: reg C API from MySQL
 
  


Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: reg C API from MySQL

2003-12-16 Thread P Arunachalam
Hello Patrick!

I am trying to connect COBOL to the MySQL Database. I
have used the C API to establish the conection to
MySQL. You have quoted that library file
mysqlclient.lib is enough.

But when I try to test the Connecton using VC++ editor
by writing a simpe C Program, the linking of
libmysql.lib only produce successdul connection.
i.e., mysqlclient.lib not required here.

But When I try to Link those two files into the Linker
for my COBOL application it wouldn't recognize the
methods inside the Libraray file (i.e, mysql_init,
mysql_real_connect, mysql_error...) and shows linker
errors. Is there any other Library files required

the platform I have used is
Windows 2k
CA REALIA II Workbench 3.0.55
CA REALIA COBOL Compiler 6.0.45
Microsoft 32 Bit incremental compiler 6.00.8168

can you please suggest me... Is there any other
library files need to be inluded...

regards,
Arun.

 --- Patrick Sherrill [EMAIL PROTECTED] wrote: 
Statically linking using C API only you will need 
 mysqlclient.lib
 
 For odbc interface you'll need to make odbc calls in
 your code and use
 myodbc.dll (Install myodbc on the client).
 
 You can mix calls, but why would you.  I have found
 the C API to be the best
 solution for us.  We statically link for dll
 avoidance. You can get the
 source or pre-built client libraries from the MySQL
 web site.
 
 I hope this helps.
 
 Pat...
 
 [EMAIL PROTECTED]
 CocoNet Corporation
 SW Florida's First ISP
 825 SE 47th Terrace
 Cape Coral, FL 33904
 
 
 
 
 
 - Original Message - 
 From: P Arunachalam [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, December 11, 2003 4:31 AM
 Subject: reg C API from MySQL
 
  


Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: reg C API from MySQL

2003-12-11 Thread Patrick Sherrill
Statically linking using C API only you will need  mysqlclient.lib

For odbc interface you'll need to make odbc calls in your code and use
myodbc.dll (Install myodbc on the client).

You can mix calls, but why would you.  I have found the C API to be the best
solution for us.  We statically link for dll avoidance. You can get the
source or pre-built client libraries from the MySQL web site.

I hope this helps.

Pat...

[EMAIL PROTECTED]
CocoNet Corporation
SW Florida's First ISP
825 SE 47th Terrace
Cape Coral, FL 33904





- Original Message - 
From: P Arunachalam [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 4:31 AM
Subject: reg C API from MySQL



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: C API AND MYSQL

2003-08-02 Thread Andy Jackman
Dave,
The documentation has several examples. Here's a function we use. Are
you having a particular difficulty?
Regards,
Andy.

snip
MYSQL *aDb = NULL;

int xConnect()
{
#define MYSQL_HOST  192.168.103.112   // or host name
#define MYSQL_DBfoodb // database name
#define MYSQL_USERIDmyuser// DB user name
#define MYSQL_PASSWORD  mypass// password

aDb = mysql_init(NULL);

if (!mysql_real_connect(aDb,MYSQL_HOST,MYSQL_USERID,
MYSQL_PASSWORD,MYSQL_DB,0,NULL,0)) {
die(701 Unable to connect\r\n);
}

return -1;
}
/snip

dave wrote:
 
 anyone have a good sample script of connecting mysql from C API? thanks
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



C API AND MYSQL

2003-08-01 Thread dave
anyone have a good sample script of connecting mysql from C API? thanks

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


A question about using C API in mysql (linux platform)

2003-04-03 Thread Li Yang
Hi, I'm a newbie to MySQL
Now I am using C to connect mysql  in Linux 
The heaser souce code like:
#include stdio.h
#include string.h
#include mysql.h   
   and After I use gcc test.c -L /usr/local/mysql/lib/ -shared  to compile it , and 
when I run the a.out ,it always say that Segmentation Fault 
   and If I use gcc test.c -L /usr/local/mysql/lib/ -static  to compile it ,It says 
that undefined reference to 'mysql_init' 
   How should I do ?
   Thanks!


Best Regards
Li Yang


Re: A question about using C API in mysql (linux platform)

2003-04-03 Thread Martin
Li:
you have to link in the mysql library mysqlclient.a in your makefile
Here is my makefile which you may use for reference
# This assumes the MySQL software is installed in /usr/local/mysql
inc  := /cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/include
lib  := /cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/lib

# If you have not installed the MySQL software yet, try this instead
#inc  :=
/cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/include:$(HOME)/mysql-4.0
/include
#lib  := $(HOME)/mysql-4.0/libmysqld

CC   := gcc
CPPFLAGS := -I$(inc) -D_THREAD_SAFE -D_REENTRANT
CFLAGS   := -g -W -Wall
LDFLAGS  := -static
# You can change -lmysqld to -lmysqlclient to use the
# client/server library
#LDLIBS= -L$(lib) -lmysqld -lz -lm -lcrypt
LDLIBS= libmysqlclient.a -lz -lm -lcrypt

ifneq (,$(shell grep FreeBSD /COPYRIGHT 2/dev/null))
# FreeBSD
LDFLAGS += -pthread
else
# Assume Linux
LDLIBS += -lpthread
endif

# This works for simple one-file test programs
sources := $(wildcard *.c)
objects := $(patsubst %c,%o,$(sources))
targets := $(basename $(sources))

all: $(targets)

clean:
 rm -f $(targets) $(objects) *.core

Keep us apprised,
Martin
- Original Message -
From: Li Yang [EMAIL PROTECTED]
To: mysql [EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 7:32 PM
Subject: A question about using C API in mysql (linux platform)


Hi, I'm a newbie to MySQL
Now I am using C to connect mysql  in Linux
The heaser souce code like:
#include stdio.h
#include string.h
#include mysql.h
   and After I use gcc test.c -L /usr/local/mysql/lib/ -shared  to compile
it , and when I run the a.out ,it always say that Segmentation Fault 
   and If I use gcc test.c -L /usr/local/mysql/lib/ -static  to compile it
,It says that undefined reference to 'mysql_init' 
   How should I do ?
   Thanks!


Best Regards
Li Yang

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: C API for mysql

2003-02-10 Thread Paul DuBois
At 14:21 + 2/7/03, Qin Lu wrote:

Hello,

I'd like to practice my C application for using mysql.

Do you know where can I find some examples?


Look in the client directory of a MySQL source distribution.  Many/most
of the standard MySQL clients are written in C.

You can also get examples at this site:

http://www.kitebird.com/mysql-book/

Get the sampdb distribution and look in its capi directory for sample
programs. These programs are discussed in the sample chapter available
at the same site (PDF format).


Which header files should I include in my code?
And which lib.a should I link to?

Many Thanks.

Qin


sql, query

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




C API for mysql

2003-02-08 Thread Qin Lu
Hello,

I'd like to practice my C application for using mysql.

Do you know where can I find some examples?
Which header files should I include in my code?
And which lib.a should I link to?

Many Thanks.

Qin



This E-Mail and any attachment is intended only for the person or entity for
which it is addressed and may contain confidential material. If you are not
the addressee or have received this E-Mail in error, please inform the
sender immediately and delete it from your computer. In addition, if you are
not the addressee or have received this E-Mail in error, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
upon it is prohibited and may be unlawful.
If this E-Mail has been transmitted outside the ordinary course of its
business, the company for which the sender works accepts no liability for
any loss or damage suffered by any person arising from any use of or
reliance on information contained in this E-Mail, and any opinion expressed
in this E-Mail is personal to the sender and may not reflect the opinion of
such company. Although the network operator makes every reasonable effort to
keep its network free from viruses, neither the network operator nor the
sender or the company for which the sender works accepts any responsibility
for computer viruses transmitted through this E-Mail or any attachments; it
is your responsibility to virus scan this E-Mail and any attachments. Any
E-Mail reply to this address may be subject to interception or monitoring
for operational reasons or for lawful business practices.




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problem using the C-API for MySQL Program breakdown after about 1Mio SQL-statements

2003-01-15 Thread Daniel Wetzler
Hallo,

I apologize for my bad english.
Im desperate about the followwing problem :

I'm using the MySQL C-API for accesssing a database with about 1.2 Mio
SQL-Statemants.
Therefor I make a connect to the database and after that a loop
starts a Subprogram about 1.2 Mio times in which a SQL-statement is sent
to the database. My problem is that the program breaks down after about
1 Mio iterations with a Bus error and Segmentation fault.
If I analyse the core dump with a debugger I get the following statements :
The program breaks down at line :

if (mysql_query(mysql2, abfrage)) {
	printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n, 
mysql_error(mysql2), abfrage);
	exit(1);



Program terminated with signal 10, Bus Error.
#0  0xff35a90c in vio_is_blocking () from 
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#1  0xff35a4e0 in net_clear () from 
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#2  0xff356abc in simple_command () from 
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#3  0xff3594e8 in mysql_real_query () from 
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#4  0x11728 in read_coor (i=1065778) at nclu-datenbank.c:279
(gdb) up


I checked the SQL statement which is sent at that time an it is ok
and leads to suitable result.



Does any one have an idea why my program breaks down ?


Greetings,


Daniel








P.S :


Here is my code for accessing the database :


(some code. )

 mysql2 = mysql_init(NULL);

if (mysql2 == NULL){
  printf (mysql_init() fehlgeschlagen (kein Speicher ?)\n);
  exit (1);
}

if (mysql_real_connect( mysql2, def_host_name, def_user_name, 
def_password, def_db_name, 0, NULL, 0) == NULL){
  printf(Datenbankverbindung hat nicht geklappt.\n);
}
printf (Datenbankverbindung 1 ok\n);


while(ergebnisarray[zaehler] != NULL) {
  /*printf (zahl = %i\n, ergebnisarray[zaehler]);*/

  j=read_coor(ergebnisarray[zaehler]);
	/* This is my fuction which sends the SQL-statements accessed 1.2 Mio 
times */
  zaehler++;

}

mysql_close(mysql2);



(some code)





In my function I access the database with the following lines :




(some code)..


  for (seglaengenzaehler = 1; seglaengenzaehler = seglength; 
seglaengenzaehler ++) {

sprintf (abfrage, select xkoor, ykoor, zkoor, id from %iloop inner 
join pdbmolekuel on m%i=molekuelnr inner join pdbatom on molekuelnr = 
molekuelzuordnung where loopnummer = %i, seglength, seglaengenzaehler, i);


  if (mysql_query(mysql2, abfrage)) {
	printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n, 
mysql_error(mysql2), abfrage);
	exit(1);
  }
  else {
	ergebnis = mysql_use_result(mysql2);
  }
}

if (ergebnis == NULL) {
  printf (Fehler beim show tables !\n Fehler : %s , 
mysql_error(mysql2));
}
else {
  /*printf (Alles in Ordnung !\n);*/

  while((myzeile = mysql_fetch_row(ergebnis)))
	{
	
	  if ( strcmp(myzeile[3],CA)==0 || strcmp(myzeile[3],N) == 0 || 
strcmp(myzeile[3],C) == 0 ||
	   strcmp(myzeile[3],O) == 0)
	{
		 // Es werden nur die Atome CA, N, C und O beachtet
		
		 coor[j] = atof(myzeile[0]);
		 coor[j+1] = atof(myzeile[1]);
		 coor[j+2] = atof(myzeile[2]);
		 j += 3;

	}
	}
  mysql_free_result (ergebnis);
}
resno = j/12;
  }



(some code)






-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: Problem using the C-API for MySQL Program breakdown after about 1 Mio SQL-statements

2003-01-15 Thread Gelu Gogancea
Hi,
Maybe it's a good ideea to increase the value of max_allowed_packet(from
my.cnf configuration file) to 2M.By default is 1MB.

Regards,

Gelu
_
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
  [EMAIL PROTECTED]
- Original Message -
From: Daniel Wetzler [EMAIL PROTECTED]
To: MySQL Mailing Liste [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 11:54 AM
Subject: Problem using the C-API for MySQL Program breakdown after about 1
Mio SQL-statements


 Hallo,

 I apologize for my bad english.
 Im desperate about the followwing problem :

 I'm using the MySQL C-API for accesssing a database with about 1.2 Mio
 SQL-Statemants.
 Therefor I make a connect to the database and after that a loop
 starts a Subprogram about 1.2 Mio times in which a SQL-statement is sent
 to the database. My problem is that the program breaks down after about
 1 Mio iterations with a Bus error and Segmentation fault.
 If I analyse the core dump with a debugger I get the following statements
:
 The program breaks down at line :

 if (mysql_query(mysql2, abfrage)) {
 printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n,
 mysql_error(mysql2), abfrage);
 exit(1);



 Program terminated with signal 10, Bus Error.
 #0  0xff35a90c in vio_is_blocking () from
 /usr/local/mysql/lib/mysql/libmysqlclient.so.10
 (gdb) up
 #1  0xff35a4e0 in net_clear () from
 /usr/local/mysql/lib/mysql/libmysqlclient.so.10
 (gdb) up
 #2  0xff356abc in simple_command () from
 /usr/local/mysql/lib/mysql/libmysqlclient.so.10
 (gdb) up
 #3  0xff3594e8 in mysql_real_query () from
 /usr/local/mysql/lib/mysql/libmysqlclient.so.10
 (gdb) up
 #4  0x11728 in read_coor (i=1065778) at nclu-datenbank.c:279
 (gdb) up


 I checked the SQL statement which is sent at that time an it is ok
 and leads to suitable result.



 Does any one have an idea why my program breaks down ?


 Greetings,


 Daniel








 P.S :


 Here is my code for accessing the database :


 (some code. )

   mysql2 = mysql_init(NULL);

  if (mysql2 == NULL){
printf (mysql_init() fehlgeschlagen (kein Speicher ?)\n);
exit (1);
  }

  if (mysql_real_connect( mysql2, def_host_name, def_user_name,
 def_password, def_db_name, 0, NULL, 0) == NULL){
printf(Datenbankverbindung hat nicht geklappt.\n);
  }
  printf (Datenbankverbindung 1 ok\n);


  while(ergebnisarray[zaehler] != NULL) {
/*printf (zahl = %i\n, ergebnisarray[zaehler]);*/

j=read_coor(ergebnisarray[zaehler]);
 /* This is my fuction which sends the SQL-statements accessed 1.2 Mio
 times */
zaehler++;

  }

 mysql_close(mysql2);



 (some code)





 In my function I access the database with the following lines :




 (some code)..


for (seglaengenzaehler = 1; seglaengenzaehler = seglength;
 seglaengenzaehler ++) {

  sprintf (abfrage, select xkoor, ykoor, zkoor, id from %iloop inner
 join pdbmolekuel on m%i=molekuelnr inner join pdbatom on molekuelnr =
 molekuelzuordnung where loopnummer = %i, seglength, seglaengenzaehler,
i);


if (mysql_query(mysql2, abfrage)) {
 printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n,
 mysql_error(mysql2), abfrage);
 exit(1);
}
else {
 ergebnis = mysql_use_result(mysql2);
}
  }

  if (ergebnis == NULL) {
printf (Fehler beim show tables !\n Fehler : %s ,
 mysql_error(mysql2));
  }
  else {
/*printf (Alles in Ordnung !\n);*/

while((myzeile = mysql_fetch_row(ergebnis)))
 {

   if ( strcmp(myzeile[3],CA)==0 || strcmp(myzeile[3],N) == 0 ||
 strcmp(myzeile[3],C) == 0 ||
strcmp(myzeile[3],O) == 0)
 {
 // Es werden nur die Atome CA, N, C und O beachtet

 coor[j] = atof(myzeile[0]);
 coor[j+1] = atof(myzeile[1]);
 coor[j+2] = atof(myzeile[2]);
 j += 3;

 }
 }
mysql_free_result (ergebnis);
  }
  resno = j/12;
}



 (some code)






 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem using the C-API for MySQL Program breakdown after about1 Mio SQL-statements

2003-01-15 Thread Daniel Wetzler
Thanks for your advice.
I tried it with the higher value (3M) but the program broke down
like before.
I increased the other buffer values too after that and am
testing now if this helps.

Greetings,

Daniel




Gelu Gogancea wrote:

Hi,
Maybe it's a good ideea to increase the value of max_allowed_packet(from
my.cnf configuration file) to 2M.By default is 1MB.

Regards,

Gelu
_
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
  [EMAIL PROTECTED]
- Original Message -
From: Daniel Wetzler [EMAIL PROTECTED]
To: MySQL Mailing Liste [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 11:54 AM
Subject: Problem using the C-API for MySQL Program breakdown after about 1
Mio SQL-statements




Hallo,

I apologize for my bad english.
Im desperate about the followwing problem :

I'm using the MySQL C-API for accesssing a database with about 1.2 Mio
SQL-Statemants.
Therefor I make a connect to the database and after that a loop
starts a Subprogram about 1.2 Mio times in which a SQL-statement is sent
to the database. My problem is that the program breaks down after about
1 Mio iterations with a Bus error and Segmentation fault.
If I analyse the core dump with a debugger I get the following statements


:


The program breaks down at line :

if (mysql_query(mysql2, abfrage)) {
printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n,
mysql_error(mysql2), abfrage);
exit(1);



Program terminated with signal 10, Bus Error.
#0  0xff35a90c in vio_is_blocking () from
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#1  0xff35a4e0 in net_clear () from
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#2  0xff356abc in simple_command () from
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#3  0xff3594e8 in mysql_real_query () from
/usr/local/mysql/lib/mysql/libmysqlclient.so.10
(gdb) up
#4  0x11728 in read_coor (i=1065778) at nclu-datenbank.c:279
(gdb) up


I checked the SQL statement which is sent at that time an it is ok
and leads to suitable result.



Does any one have an idea why my program breaks down ?


Greetings,


Daniel








P.S :


Here is my code for accessing the database :


(some code. )

 mysql2 = mysql_init(NULL);

if (mysql2 == NULL){
  printf (mysql_init() fehlgeschlagen (kein Speicher ?)\n);
  exit (1);
}

if (mysql_real_connect( mysql2, def_host_name, def_user_name,
def_password, def_db_name, 0, NULL, 0) == NULL){
  printf(Datenbankverbindung hat nicht geklappt.\n);
}
printf (Datenbankverbindung 1 ok\n);


while(ergebnisarray[zaehler] != NULL) {
  /*printf (zahl = %i\n, ergebnisarray[zaehler]);*/

  j=read_coor(ergebnisarray[zaehler]);
/* This is my fuction which sends the SQL-statements accessed 1.2 Mio
times */
  zaehler++;

}

mysql_close(mysql2);



(some code)





In my function I access the database with the following lines :




(some code)..


  for (seglaengenzaehler = 1; seglaengenzaehler = seglength;
seglaengenzaehler ++) {

sprintf (abfrage, select xkoor, ykoor, zkoor, id from %iloop inner
join pdbmolekuel on m%i=molekuelnr inner join pdbatom on molekuelnr =
molekuelzuordnung where loopnummer = %i, seglength, seglaengenzaehler,


i);



  if (mysql_query(mysql2, abfrage)) {
printf (Fehler bei der Abfrage ! Fehler : %s \n %s \n,
mysql_error(mysql2), abfrage);
exit(1);
  }
  else {
ergebnis = mysql_use_result(mysql2);
  }
}

if (ergebnis == NULL) {
  printf (Fehler beim show tables !\n Fehler : %s ,
mysql_error(mysql2));
}
else {
  /*printf (Alles in Ordnung !\n);*/

  while((myzeile = mysql_fetch_row(ergebnis)))
{

 if ( strcmp(myzeile[3],CA)==0 || strcmp(myzeile[3],N) == 0 ||
strcmp(myzeile[3],C) == 0 ||
  strcmp(myzeile[3],O) == 0)
   {
// Es werden nur die Atome CA, N, C und O beachtet

coor[j] = atof(myzeile[0]);
coor[j+1] = atof(myzeile[1]);
coor[j+2] = atof(myzeile[2]);
j += 3;

   }
}
  mysql_free_result (ergebnis);
}
resno = j/12;
  }



(some code)






-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







-
Before

C++ API for Mysql

2002-05-06 Thread Hisseine Dj.

Hello,

Can someone tell me if there is an C++ API that works smooth with MYSQL on
linux.
So far I was trying msql++ and SQLAPI++.
SQLAPI++ seems to be good by there are problems when runing the program.

My system is Redhat 7.2  and Mysql 3.23.49


Thanks,

Hisseine




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




C++ API for Mysql

2002-05-06 Thread Hisseine Dj.

Hello,

Can someone tell me if there is an C++ API that works smooth with MYSQL on
linux.
So far I was trying msql++ and SQLAPI++.
SQLAPI++ seems to be good by there are problems when runing the program.

My system is Redhat 7.2  and Mysql 3.23.49


Thanks,

Hisseine





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




SV: C++ API for Mysql

2002-05-06 Thread Carsten Gehling

You can download MySQL++ from www.mysql.com

- Carsten

 -Oprindelig meddelelse-
 Fra: Hisseine Dj. [mailto:[EMAIL PROTECTED]]
 Sendt: 6. maj 2002 17:24
 Til: [EMAIL PROTECTED]
 Emne: C++ API for Mysql


 Hello,

 Can someone tell me if there is an C++ API that works smooth with MYSQL on
 linux.
 So far I was trying msql++ and SQLAPI++.
 SQLAPI++ seems to be good by there are problems when runing the program.

 My system is Redhat 7.2  and Mysql 3.23.49


 Thanks,

 Hisseine




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: C++ API for Mysql

2002-05-06 Thread Hisseine Dj.

Hi Carsten,

I've tried Mysql++ and SQLAPI.
I am asking if someone out there know about other best tools in C++ for
Mysql on linux.

Thanks,

Hisseine


- Original Message -
From: Carsten Gehling [EMAIL PROTECTED]
To: Hisseine Dj. [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, May 06, 2002 11:31 AM
Subject: SV: C++ API for Mysql


 You can download MySQL++ from www.mysql.com

 - Carsten

  -Oprindelig meddelelse-
  Fra: Hisseine Dj. [mailto:[EMAIL PROTECTED]]
  Sendt: 6. maj 2002 17:24
  Til: [EMAIL PROTECTED]
  Emne: C++ API for Mysql
 
 
  Hello,
 
  Can someone tell me if there is an C++ API that works smooth with MYSQL
on
  linux.
  So far I was trying msql++ and SQLAPI++.
  SQLAPI++ seems to be good by there are problems when runing the program.
 
  My system is Redhat 7.2  and Mysql 3.23.49
 
 
  Thanks,
 
  Hisseine
 
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
  [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




newbie : Help with C api for mysql

2002-03-18 Thread jim and lois flaherty

I have a Redhat 7.1 box, I want it to connect to its own mysql db . Here is
my code


#include stdio.h;
#include mysql.h;

int main(char **args){

   MYSQL_RES *result;
   MYSQL_ROW row;
   MYSQL *connection, mysql;

   int state;


/*  connect to the mysql db  */

mysql_init(mysql);

connection =
mysql_real_connect(mysql,localhost,root,password,cram,3306,0, 0);


/* check for connection error */






###
it doent compile right , I get




 gcc analysis.c



analysis.c:6:19: warning: extra tokens at end of #include directive
analysis.c:7:19: warning: extra tokens at end of #include directive
/tmp/ccsKk2GG.o: In function `main':
/tmp/ccsKk2GG.o(.text+0x14): undefined reference to `mysql_init'
/tmp/ccsKk2GG.o(.text+0x40): undefined reference to `mysql_real_connect'
collect2: ld returned 1 exit status


What Am I doing Wrong ??


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail mysql-unsubscribe-##L=##[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: newbie : Help with C api for mysql

2002-03-18 Thread Sammy Lau

jim and lois flaherty wrote:
  gcc analysis.c
 
 analysis.c:6:19: warning: extra tokens at end of #include directive
 analysis.c:7:19: warning: extra tokens at end of #include directive
 /tmp/ccsKk2GG.o: In function `main':
 /tmp/ccsKk2GG.o(.text+0x14): undefined reference to `mysql_init'
 /tmp/ccsKk2GG.o(.text+0x40): undefined reference to `mysql_real_connect'
 collect2: ld returned 1 exit status
 
 What Am I doing Wrong ??
 

you need -lmysqlclient.

check http://www.mysql.com/doc/C/C/C.html for more details.

-- 
Sammy Lau
mailto: [EMAIL PROTECTED]
- Tell me what you want and I'll tell you how you can live without it.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problem with C API and mysql

2001-06-05 Thread kenneth johansen

hello everybody.
Ive been working with perl and mysql for some time, but recently i had
to move over
to C and as such i wrote a small test program, just to get to know the
mysql C API.
Well, things didnt go as i thought. i kept getting linking problems
and in the end my test program was limited to the few lines bellow:

#include stdlib.h
#include mysql.h
#include unistd.h
#include stdio.h

int main(){

  MYSQL *mysql;

mysql = mysql_init(NULL);
  if (mysql == NULL) {
fprintf(stderr,mysql_init() failed (foobar\n);
exit(1);
  }
}
+

i compile this with:
gcc -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ program.c
-lmysqlclient

but i always get the error message:
/usr/local/mysql/lib//libmysqlclient.a(my_compress.o): In function
`my_uncompress':
my_compress.o(.text+0x97): undefined reference to `uncompress'
/usr/local/mysql/lib//libmysqlclient.a(my_compress.o): In function
`my_compress_alloc':
my_compress.o(.text+0x12b): undefined reference to `compress'
collect2: ld returned 1 exit status

doing an nm on libmysqlclient.a does reveal that the compress functions
are there,but
for some reason it wont work.

appriciate any/all help

regards
[EMAIL PROTECTED]


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem with C API and mysql

2001-06-05 Thread Gerald Clark



kenneth johansen wrote:

}
 +
 
 i compile this with:
 gcc -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ program.c
 -lmysqlclient
 

add -lz

-- 
Gerald L. Clark
[EMAIL PROTECTED]


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem with C API and mysql

2001-06-05 Thread Sinisa Milivojevic

kenneth johansen writes:
 hello everybody.
 Ive been working with perl and mysql for some time, but recently i had
 to move over
 to C and as such i wrote a small test program, just to get to know the
 mysql C API.
 Well, things didnt go as i thought. i kept getting linking problems
 and in the end my test program was limited to the few lines bellow:
 
 #include stdlib.h
 #include mysql.h
 #include unistd.h
 #include stdio.h
 
 int main(){
 
   MYSQL *mysql;
 
 mysql = mysql_init(NULL);
   if (mysql == NULL) {
 fprintf(stderr,mysql_init() failed (foobar\n);
 exit(1);
   }
 }
 +
 
 i compile this with:
 gcc -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ program.c
 -lmysqlclient
 
 but i always get the error message:
 /usr/local/mysql/lib//libmysqlclient.a(my_compress.o): In function
 `my_uncompress':
 my_compress.o(.text+0x97): undefined reference to `uncompress'
 /usr/local/mysql/lib//libmysqlclient.a(my_compress.o): In function
 `my_compress_alloc':
 my_compress.o(.text+0x12b): undefined reference to `compress'
 collect2: ld returned 1 exit status
 
 doing an nm on libmysqlclient.a does reveal that the compress functions
 are there,but
 for some reason it wont work.
 
 appriciate any/all help
 
 regards
 [EMAIL PROTECTED]
 


Just add -lz to linker command.


Regards,

Sinisa

    __ _   _  ___ ==  MySQL AB
 /*/\*\/\*\   /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/   \*\_   |*|   |*||*| mailto:[EMAIL PROTECTED]
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*| Larnaca, Cyprus
  /*/ /*/  /*/\*\_/*/ \*\_/*/ |*|
  /*/^^^\*\^^^
 /*/ \*\Developers Team

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php