I need to get the complete query with the filled values after the query got successfully executed, (basically I want the query string with the question marks in the query removed and get replaced with corresponding values) so that I can use it for transaction logging.
below are the lines of code that I am using
$stmt1 = $dbh->prepare("INSERT INTO announcements(id,routeID,ServiceAdvisoryID,ServiceAdvisoryDetailsId)
VALUES (?,?,?,?)");
$stmt1->execute(array($aid,$route,$anctype,$announcementid));
the query used for transaction logging is
$transactionText = "INSERT INTO announcements(id,routeID,ServiceAdvisoryID,ServiceAdvisoryDetailsId) VALUES (?,?,?,?)";
$stmt2 = $dbh->prepare("insert into transactionLog_tbl(userName,transactionTypeId,transactionTime,transactionText)values(?,?,?,?)");
$stmt2->execute(array($_SESSION['username'],1,date("y.d.m"),$transactionText));
I want transaction text to have question marks filled with corresponding values.
or else
Can i get the last executed ROW by a PDO. I know we can get the ID but cam we get the complete row as well?
Any help would be greatly appreciated.