Jump to content
Larry Ullman's Book Forums

How to create prepared statements for incremental value in a query


Recommended Posts

Hello,

I am having problem in creating prepared statements for the below code example. The $s_id has auto incremental value.

Will someone point me with an example on how to do this according to the code below?

$s_id = $db->insert_id;
$update = $db->query("UPDATE mb SET s_id = {$s_id} WHERE id = {$cs}");

Thank you.

Link to comment
Share on other sites

I'm not quite following the use case here (why you'd update a table to an auto-increment value) but, more importantly, this isn't a prepared statement? Could you provide a bit more code? Also, when you say you're having a problem, what is happening that shouldn't? Are you seeing any error messages? 

Link to comment
Share on other sites

 Share

×
×
  • Create New...