MySQL Forums
Forum List  »  Source, Builds, Binaries

Re: How to pass values (host variables) to SQL
Posted by: Vengadessa Djearamane
Date: February 02, 2010 12:59PM

Thanks, found the answer:
sprintf(stmt, "select * from users where userid = %d", id);

fprintf(stderr, stmt);

/* if (0 != mysql_query(conn, "select * from users where userid = $name")) */

if (0 != mysql_query(conn, stmt) )
{
fprintf(stderr,"Error query: %s \n", mysql_error(conn));
exit (1);
}

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to pass values (host variables) to SQL
1822
February 02, 2010 12:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.