Single or Double quotes on database input or search
Posted: Thu Jan 29, 2009 12:13 pm
I was just wondering if there is any difference/advantage to using single or double quotes when conducting MySQL queries through PHP.
Example of what I am talking about:
SEARCHING:
Does the single or double quote effect the data being put in or the data being searched in any way? Is one faster than the other?
Thank you for your input in advance.
Example of what I am talking about:
Code: Select all
<?php
$sql = mysql_query("UPDATE `table` SET `username`='name_of_person'");
VS
$sql = mysql_query('UPDATE `table` SET `username`="name_of_person"');
?>Code: Select all
<?php
$sql = mysql_query("SELECT * FROM `table` WHERE `username`='name_of_person'");
VS
$sql = mysql_query('SELECT * FROM `table` WHERE `username`="name_of_person"');
?>Thank you for your input in advance.