mardi 29 avril 2014

Which kind of quote combination is preferred for MySQL queries in PHP?


Vote count:

0




When inserting into MySQL with PHP, I can do either of the following:



$query = 'INSERT INTO tablename SET id = "4"';
$query = "INSERT INTO tablename SET id = '4'";
$query = 'INSERT INTO tablename SET id = \'4\'';
$query = "INSERT INTO tablename SET id = \"4\"";


Is there a reason (security, performance, code readability, ...) why I should prefer one of them?



asked 2 mins ago

what

658





Aucun commentaire:

Enregistrer un commentaire