php - Function doesn't updates Mysql table -
i have written small function has 2 update 2 column. doesn't works how should work. there's column in table named currentstatus it's value has changed queued completed , column usedtimes values needs incremented +1. increment doesn't happen well.
i've been trying fix past couple of hours..but doesn't seem work.
what might issue? suggestions appreciated.
function updatemessagequeue($indexid) { //this function update messagequeue has been completed $status = "completed"; global $conn; try { $statement = $conn->prepare("update messagequeue set currentstatus = :currentstatus , usedtimes = usedtimes+1 indexid = :index "); $statement->bindparam(':currentstatus',$status); $statement->bindparam(':index',$indexid); $statement->execute(); $statement->closecursor(); } catch(pdoexception $e) { echo $e->getmessage(); } }
use this
update messagequeue set currentstatus = :currentstatus , usedtimes = usedtimes+1 indexid = :index
Comments
Post a Comment