List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 16 1999 3:31am
Subject:Re: query inside a function
View as plain text  
At 10:17 AM +0800 1999-12-16, ~*~shan~*~ wrote:
>i have a parsing function in my code.
>and inside the function i put a query inside it...
>i was wondering why it isn't working.., it seems
>as if the compiler is ignoring it or something...
>the program has no error whatsoever but
>whenever i checked the database.. the query
>i put isn't being performed...why is this so?
>do i have to reconnect it to the mysql server?
>
>my code goes like this
>
>main
>{
>mysql_connect(blah-blah)
>...
>...
>Parse_func();
>...
>...
>mysql_close(&mysql);
>}
>
>Parse_func(void)
>{
>...
>...
>...
>mysql_query(&mysql, "CREATE TABLE test (name char(25)");
>...
>...
>...
>}
>
>the highlighted part is not being performed...
>whatever query put inside the function is
>not being performed....

Your query is missing a terminating parenthesis.

You have:
	CREATE TABLE test (name char(25)
not:
	CREATE TABLE test (name char(25))

Of course, you don't know whether you have even established
a connection successfully, because you don't check the result
of your connection call.

-- 
Paul DuBois, paul@stripped
Thread
query inside a function~*~shan~*~16 Dec
  • Re: query inside a functionPaul DuBois16 Dec
  • Re: query inside a functionsinisa16 Dec
Re: query inside a functionTim Armbruster16 Dec