I am wondering about the safe or correct way to pass a $variable to a query. I am new to PHP thats why I am asking such beginner question. Here is the example one and two, which one is correct and safer because of symbols?
Example one:
//here is the line I am asking about. The $identification
$query = "SELECT * FROM `members` WHERE `username` = '$identification' LIMIT 1";
Example two:
//here is the line I am asking about. The $identification
$query = "SELECT * FROM `members` WHERE `username` = '" . $identification . "' LIMIT 1";
I don't need answers about PHP 4 or 5 or PDO. I just need to know what is correct:
This
'" . $identification . "'
Or this
'$identification'