howto insert a variable in a query in C?

2001-06-13 Thread Kenneth Johansen

hi all, im currently using a C program to access my mysql database.
but i have a small question.
How do i insert a variable into a query?
imagine:
*query=select blah,blah from table_name where name = variable;

im a bit in the dark on this one and would appriciate any/all suggestions.

regards
kenneth johansen
[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: howto insert a variable in a query in C?

2001-06-13 Thread Benjamin Pflugmann

Hi.

This is not really a MySQL related question, but something about C
basics, IMHO.

On Wed, Jun 13, 2001 at 04:38:28PM +0200, [EMAIL PROTECTED] wrote:
 hi all, im currently using a C program to access my mysql database.
 but i have a small question.
 How do i insert a variable into a query?
 imagine:
 *query=select blah,blah from table_name where name = variable;

Have a look at the snprintf() function.

Bye,

Benjamin.


-
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