I have arranged some MySQL C API examples at
http://www.geocities.com/jahan.geo/mysql_c_by_example.html


Larry Brown wrote:
On Sat, 2004-08-28 at 00:48, I wrote:

I know this is more along the lines of a c question; however, I am
trying to write a loop to iterate insertions into a mysql database and
was hoping someone would have a quick fix for this.

I am used to using php with the luxury of the following syntax

< some loop giving values $column1 and $column2 usually from some array or parsing of a file>

$query = mysql_query( "insert into my_table values ( null, '$column1',
'some description $column2'" );

< next iteration >

Can anyone just show a one liner of how to do this in c where the values
are column1 and column2?  I know there is a string concatenation
function, it just seems so clumsey to write it out, get the string
length of each of the two variables and create a new longer line.  I
won't be suprised if that is what I have to do though.  ( being new to c
and finding out how much more work it entails:-) ).

Hope this make since at nearly 1 am.  Been a long day...




OK, hate to answer my own question but sprintf is what I was looking
for.  It is hard to switch languages!  Especially in this direction. ;-)



--

Aftab Jahan Subedar
CEO/Software Engineer
Subedar Technologies
Subedar Baag
Bibir Bagicha #1
North Jatrabari
Dhaka 1204
Bangladesh
http://www.SubedarTechnologies.com
http://www.DhakaStockExchangeGame.com/
http://www.CEOBangladesh.com/
http://www.NYSEGame.com
tel://+88027519050
EMail://[EMAIL PROTECTED] - Directly to my notebook


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to