I am querying my database with pdo prepared statements and I can not figure out how to return the actual query after executing the query.
I have tried print_r($statement);
, but all that does is give the the pdo prepared query.
Any help will be much appreciated!
$sql = ("SELECT * FROM `mySite` WHERE `info` LIKE :checkSite OR `users` LIKE :checkSite");
$stmt = $pdo->prepare($sql);
$stmt->bindParam(":checkSite", "%$checkSite%");
$stmt->execute();
$results = $stmt->fetchAll();
foreach($results as $row){
echo $row['users'];
}