ive started updating my code from mysql to pdo, and im not very bright and get easily mad. which ive gotten now. i dont understand why this isnt working, and id like anyones help why. the mysql code is commented out of the section (it works, but want pdo). the pdo code isnt working however and i cant understand why.
can someone help me?
$result_bajs = "SELECT * FROM comments WHERE movie_id = :id ORDER BY post_date DESC";
$stmt2 = $pdo->prepare($result_bajs);
$stmt2 = execute(array(
':id' => $id
));
$result2 = $stmt2->fetchAll();
while($row = $result2){
//$result2 = mysql_query($result_bajs, $connection) or die (mysql_error());
$ip = $_SERVER['REMOTE_ADDR'];
//while ($row = mysql_fetch_array($result2)) {
$comment = $row['comment'];
$author = $row['author'];
$post_date = $row['post_date'];