ricmetal Posted April 21, 2009 Share Posted April 21, 2009 so how do i do it? all i find is how to update one column ive tried SET (col1,col2) VALUES ($var1, $var2) WHERE... and SET col1 = ?, col2 = ? WHERE but these havent worked appretiate help Link to comment https://forums.phpfreaks.com/topic/155078-solved-updating-multiple-columns-with-mysqli-prepared-statements/ Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 This shows you what you need to do: http://uk3.php.net/manual/en/mysqli-stmt.bind-param.php If you're asking for help with the update syntax it's: UPDATE `table` SET `field` = 'value', `field2` = 'value2' WHERE `field3` = 'value3' Link to comment https://forums.phpfreaks.com/topic/155078-solved-updating-multiple-columns-with-mysqli-prepared-statements/#findComment-815695 Share on other sites More sharing options...
Mchl Posted April 21, 2009 Share Posted April 21, 2009 Too little code to help. Link to comment https://forums.phpfreaks.com/topic/155078-solved-updating-multiple-columns-with-mysqli-prepared-statements/#findComment-815699 Share on other sites More sharing options...
ricmetal Posted April 21, 2009 Author Share Posted April 21, 2009 sorry, i got it working it was a missing 's' i just asked cause i didnt find this exaxmple online, and was guessing $stmt = $mysqli->prepare("UPDATE table SET col1 = ?, col2 = ?, col3 = ? WHERE id = ? ") $stmt->bind_param('sssi', $var1, $var2, $var3, $id); Link to comment https://forums.phpfreaks.com/topic/155078-solved-updating-multiple-columns-with-mysqli-prepared-statements/#findComment-815747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.