Forum Moderators: coopster
$db_name = "premiers_listings"; I get good connect etc., but always get this error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'art,trash art,6.99,1.99,19.99,FedEx,30,http://www.example.com $meminfo[x] is data pulled out of an uploaded tab delimited file and contains: 33221 \t Trash \t Art \t Trash art \t trash art \t 6.99 \t 1.99 \t 19.99 \t FedEx \t 30 \t http://www.example.com/visa_small.gif \t http://www.example.com/visa_med.gif \t http://www.example.com/visa_small.gif \t http://www.example.com/visa_small.gif \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t 1 \t username \t 3.11.06 \t http://www.example.com Gotta be something stupid, but I don't have a clue at the time. All table fields are set to TEXT. [1][edited by: jatar_k at 8:51 pm (utc) on April 13, 2006]
$table_name = "art";
$connection = mysql_connect("localhost","account","password") or die ("MySQL Connection Error.");
$db = mysql_select_db($db_name, $connection) or die ("MySQL DbName Error.");
$sql = "INSERT INTO $table_name VALUES (".$meminfo[0].", ".$meminfo.", ".$meminfo[2].", ".$meminfo[3].", ".$meminfo[4].", ".$meminfo[5].", ".$meminfo[6].", ".$meminfo[7].", ".$meminfo[8].", ".$meminfo[9].", ".$meminfo[10].", ".$meminfo[11].", ".$meminfo[12].", ".$meminfo[13].", ".$meminfo[14].", ".$meminfo[15].", ".$meminfo[16].", ".$meminfo[17].", ".$meminfo[18].", ".$meminfo[19].", ".$meminfo[20].", ".$meminfo[21].", ".$meminfo[22].", ".$meminfo[23].", ".$meminfo[24].", ".$meminfo[25].", ".$meminfo[26].", ".$_COOKIE["verify"].", ".(date(m)."/".date(d)."/".date(y)).", ".$meminfo[27].")";
$result = mysql_query($sql,$connection) or die("MySQL SQL,Connection Error.\n".mysql_error());
(I inserted \t so you could tell where tabs are).
[edit reason] fixed sidescroll [/edit]
$sql = "INSERT INTO $table_name VALUES (,".$meminfo[0].",".$meminfo[1].",".$meminfo[2].",".$meminfo[3].",".$meminfo[4].")";
This is the latest I've tried. Now I'm seeing the first two fields in the error message that I have not seen before...
MySQL SQL,Connection Error. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '33221,Trash,Art,Trash art,trash art)' at line 1
Still plutzing around with it. Any ideas greatly appreciated!
RC
$sql = "INSERT INTO $table_name VALUES ('',".$meminfo[0].",".$meminfo[1].",".$meminfo[2].",".$meminfo[3].",".$meminfo[4].")";
Now I get a little different error, not showing my first two fields:
MySQL SQL,Connection Error. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'art,trash art)' at line 1