Jump to content

Need help with trying to make UPDATE write data to the database


Redlightpacket

Recommended Posts

Here is my error message I get.

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 '[1] = 'listen'' at line 1

 

Some how it won't write data in the first and next and next fields in my database table.

 

 



//Trying to make this data go into the database table.

//SET
$column=array("listen","date","message");
$value=array("listen","date","message");


//WHERE
$column2=array("video","listen","date");
$value2=array("video","listen","date");



$counts = 1;
while($counts < 4)
{
$counts = 0 + $counts;	
$n = 1;
$n2 = 1;
$n = 0 + $n;
$n2= 0 + $n2;

$result =  mysql_query("UPDATE _0_sermon_data_file SET $column[$n] = '$value[$n]' WHERE column2[$n2] = '$value2[$n2]'")
or die(mysql_error());


}


///////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.