On Sun, 25 Mar 2001 12:56:15 -0800 (PST), john lin <[EMAIL PROTECTED]>   wrote:

John,

I'm not a 'C' programmer, but I think you need to enclose your VALUE with single
quotes for a literal value: VALUES('test')

Atleast in Perl, it' done that way.

 
>>I am a senior in Polytechnic University working on my
>>senior project.  I have chosen MySQL to be database in
>>Red Hat linux 7.0.  I writing a program to insert a
>>value into the database in c language.  The data
>>changes so i have to insert the data as a variable,
>>but the database reports a error saying that the data
>>is a column, the code is something like this..
>>
>>int main(int argc, char **argv)
>>{
>>..
>>char* test;
>>test="abcd";
>>int res;
>>MySQL *connection;
>>
>>res=mysql_query(connection, "INSERT INTO tablename
>>(userid) VALUES(test));
>>
>>}
>>
>>I get an error saying "Insert error 1054, unknown
>>column 'test' in 'field-list'

Mike(mickalo)Blezien
========================================
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002
=========================================















---------------------------------------------------------------------
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

Reply via email to