Re[4]: [PHP-DB] Insert into command - PHP

From: Date: Fri, 29 Mar 2002 18:50:52 +0000
Subject: Re[4]: [PHP-DB] Insert into command - PHP
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18040@lists.php.net to get a copy of this message
PHP-DB Mailing List Hello Jonathan, -- Friday, March 29, 2002, 12:16:19 PM, you wrote: > It should be: > $sql = "Insert into table > ('$field1','$field2',....,'$field61')"; > mysql_query($sql) or die(msql_error()); Thanks that is helpful. > It's a little easier to read and understand. Note that you don't really have > to do anything special to be able to separate the query onto multiple lines: > $sql = "INSERT INTO > table > SET > field='value', > field2='value'; > "; > mysql_query($sql) or die(msql_error()); I re coded as per the suggestion above. Still, I get a new error message, "You have an error in your SQL syntax near " at line 55." Line 55 is R38='$R38', > ... will work fine. No need for special characters - PHP will recognize > values and strings that are on multiple lines AS LONG AS the value starts > and ends with quotes (and the semicolon at the end). > field2='value'; > "; Any suggestions..... Jerry -- Ethan J. Mings Office E-mail thedesk@ejmings.com

« previous php.db (#18040) next »