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




RE: howto insert a variable in a query in C?

2001-06-13 Thread Diego Zabaleta


 sprintf(query,"select blah,blah from table_name where name =
'%s'",variable);

-Mensaje original-
De: Kenneth Johansen [mailto:[EMAIL PROTECTED]]
Enviado el: MiƩrcoles, 13 de Junio de 2001 11:38 a.m.
Para: [EMAIL PROTECTED]
Asunto: howto insert a variable in a query in C?


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

-
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




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