SQL Update Problem
I am trying to update a record in MySQL DB but nothing is being changed.
Here is the line I am using to try to get the record updated.
$sql = "UPDATE ".$this->Tbl." SET name = '".$data['name']."', title = '".$data['title']."', message = '".$data['message']."', ', picture = '".$filename_update.".jpg' WHERE id = '".$data['id']."'";
echo $sql;
$db->connect();
$result = mysql_query($sql);
$db->disconnect();
return $result;
开发者_C百科
There are no errors being reported. In fact I am getting confirmation that all the information is correct in the update line.
I noticed that right before your picture
column, you have an extra ',
. Perhaps this is causing the issue?
When you execute that statement, perhaps try checking for number of records effected.
echo mysql_affected_rows();
It's really hard to say what's happening without seeing the SQL string you construct.
At a guess, however, you have an embedded single quotation mark in message or another variable.
精彩评论