Reuse MYSQL object instead of multiple connections?

2002-11-20 Thread Anna Fowles-Winkler
Hi, Currently, my program creates a new MYSQL object each time a connection is needed to save or load information from my MySQL database. Sometimes, this connection is created 10,000 or more times during one use of the program. I'm wondering if I reuse the connection (have a static MYSQL

Re: Does mysql_real_connect allocate memory?

2002-11-20 Thread Anna Fowles-Winkler
; mysql_init (mysql); mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0); -=| Ben - Original Message - From: Anna Fowles-Winkler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 2:58 PM Subject: Does mysql_real_connect allocate memory? Hi

Does mysql_real_connect allocate memory?

2002-11-19 Thread Anna Fowles-Winkler
Hi, Does the MySQL C API function mysql_real connect allocate memory or do I need to do it? This is what my code currently does: MYSQL *mysql; mysql = new MYSQL mysql_init(mysql); mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0); Thanks, Anna

Re: mysql_real_query and escaping a semicolon

2002-04-29 Thread Anna Fowles-Winkler
Gerald Clark wrote: The semicolon does not belong there. Where? At the end of the query or in the string? --Anna Anna Fowles-Winkler wrote: Anna Fowles-Winkler wrote: Paul DuBois wrote: Paul DuBois wrote: At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote: Well, the function

Re: mysql_real_query and escaping a semicolon

2002-04-29 Thread Anna Fowles-Winkler
, allow_1, allow_2, allow_3, allow_4, allow_5, allow_6) VALUES ('Eye Movement Time',1,NULL,'per',0,'.1;',0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,1) Paul DuBois wrote: At 8:37 -0600 4/29/02, Anna Fowles-Winkler wrote

mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler
Hi, I have an insert command that I'm executing through the C API function mysql_real_query. One of my values is a string like this: '1;' When mysql_real_query sees the ;, it thinks it's the end of the statement. How can I prevent that from happening? Is there a way to escape it? Thanks

Re: mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler
Well, the function is called like this: mysql_real_query( mysql_connection, query_string, strlen( query_string )); Wouldn't that pass the correct length? --Anna Paul DuBois wrote: At 14:03 -0600 4/26/02, Anna Fowles-Winkler wrote: Hi, I have an insert command that I'm executing through

Re: mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler
Paul DuBois wrote: At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote: Well, the function is called like this: mysql_real_query( mysql_connection, query_string, strlen( query_string )); Wouldn't that pass the correct length? Not necessarily. Uhm... why not? Wouldn't strlen return

Re: mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler
Paul DuBois wrote: Paul DuBois wrote: At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote: Well, the function is called like this: mysql_real_query( mysql_connection, query_string, strlen( query_string )); Wouldn't that pass the correct length? Not necessarily. Uhm

Re: mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler
Anna Fowles-Winkler wrote: Paul DuBois wrote: Paul DuBois wrote: At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote: Well, the function is called like this: mysql_real_query( mysql_connection, query_string, strlen( query_string )); Wouldn't that pass the correct