Sunday, 8 September 2013

UPDATE prepared statement executed without errors but table not getting updated

UPDATE prepared statement executed without errors but table not getting
updated

I'm inserting data into a table and then updating some fields which values
where not inserted. The code works without any errors but fields don't get
updated.
Here is my code:
$mysqli = new mysqli("localhost", "root", "", "mydb");
$stmt = $mysqli->prepare("UPDATE my_table SET field1=?,
field2=?,
field3=?,
field4=?,
field5=?,
field6=?,
field7=?,
field8=?,
field9=?,
field10=?,
field11=?,
field12=?,
field13=?,
updateTime=now()
WHERE id=?");
$stmt->bind_param('isssssssssssss', $info['x'],
$info['x2'],
$info['x3'],
$info['x4'],
$info['x5'],
$info['x6'],
$info['x7'],
$info['x8'],
$info['x9'],
$info['x10'],
$info['x11'],
$info['12'],
$info['x13'],
$_GET['id']);
$stmt->execute();
Columns and variables' names have been changed but on the original code,
they match existing columns.
Thank you very much.

No comments:

Post a Comment