Jump to content

Mysql query syntax error problem


tfe

Recommended Posts

Changed query to:

 

$result = mysql_query("INSERT INTO messages_folders(id,recipient,sender,number,updated,title) 
VALUES (".implode(",", $folders).") ON duplicate KEY UPDATE number=number+1") or die(mysql_error());

 

Now I am getting another error:

 

Column count doesn't match value count at row 1

 

Don't know how is it possible if $folder value count is the same:

 

array_push($folders, "(NULL,'$tid','$id','1','$timestamp','$name')");

 

Maybe I need to open another thread. Actually I am looking for solution how to send/delete multiple mssages at the same time (with implode) and then to update number of messages for each folder. Updating doesn't work correctly if I use "implode".  :-[

Here is the echo result:

 

INSERT INTO messages_folders(id,recipient,sender,number,updated,title) VALUES ((NULL,'10618','60','1','1309962951','test')) ON duplicate KEY UPDATE number=number+1

 

I don't see any problem but this query still returns error: "Column count doesn't match value count at row 1"

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.