In the last episode (Jan 22), Kc9cdt@stripped said:
> Doing C coding with MSql.
> What am I missing here?
> I am needing to do standard INSERT statements using variables for the
> VALUE fields These fields are changed in the application befre I
> issue the INSERT. The current proram uses : before the variable to
> make it work.
> Like this: INSERT INTO EMP_MASTER (EMP_NO, SUPERVISOR,BADGE_NO)
> VALUES (:emp_no, :super, :badge_no);
> The :emp_no etc. is obviously what is not working...Why?
Mysql doesn't support named bind variables in the C API; it only
understands the "?" markers. If you take a look at the MYSQL_BIND
struct, you can see there is no name field. Which really just means
that when you call mysql_stmt_bind_param() you have to pass your
variables in the same order as they appeared in your query when you
This has some example code:
My guess is that if you were to extend mysql_stmt_prepare() and
mysql_stmt_bind_param() to support named variables and submitted them
to bugs.mysql.com as a patch, no-one would object :)