You can also use this mySQL syntax:
INSERT INTO table SET field1='$value1', field2='$value2', ...etc Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com > -----Original Message----- > From: chris allen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 03, 2002 10:01 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Query from POST_VARS > > Question on a mysql insert query: > > while(list($key, $val) = each($HTTP_POST_VARS)) { > > $string .= "'". $val ."'" .","; > } > > $insert_query = "insert into data_16 values ('$string')"; > > > Do I need the single quotes for data being put into table? > Ex: > > $insert_query =('data' , 'data2', 'data3') etc.... > > or can it be without the single quotes? > as in > > (data, data2, data3) ??? > > As far as I understand I only need quotes here: > > $insert_query = "insert into data_16 values ('$string')"; > ^ ^ > > > Am i right?? > > > thanks > -ccma > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php