I have been following this tutorial relatively easily until I came across this block of code:
$query = mysql_query("SELECT first_name, last_name FROM people WHERE id = " . $inAuthorId);
$row = mysql_fetch_assoc($query);
$this->author = $row["first_name"] . " " . $row["last_name"];
I remember that I should stay away from mysql_ functions, as recommended by the php.net site.
However, I just would like to understand the first line of the code.
From my understanding, I am taking the first_name and last_name data from the table "people". However, I do not understand the
"WHERE id = " . $inAuthorId part.
Also, I would appreciate if I could see the block of codes in PDO form.
Thanks!

New Topic/Question
Reply



MultiQuote






|