I have written this small function which has two update two column. But it doesn't works how it should work. There's a column in the table named as currentstatus it's value has to be changed from Queued to Completed and a column usedtimes whose values needs to be incremented by +1. The increment doesn't happen as well.
I've been trying to fix this past couple of hours..but this doesn't seem to work.
What might be the issue? Any suggestions is appreciated.
function updateMessageQueue($indexid)
{
//this function would update that the messagequeue has been completed
$status = "Completed";
global $conn;
try
{
$statement = $conn->prepare("UPDATE messagequeue set currentstatus = :currentstatus AND usedtimes = usedtimes+1 where indexid = :index ");
$statement->bindParam(':currentstatus',$status);
$statement->bindParam(':index',$indexid);
$statement->execute();
$statement->closeCursor();
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}