MySQL Query Syntax Question
Posted: Mon Jan 27, 2003 5:19 pm
I have this line in my PHP script:
$delivery = mysql_query("SELECT delivery_city FROM order_summaries WHERE order_number = '$_SESSION[CartNumber]'");
It works fine, but I believe that proper syntax would require a quote marks around the Session array key CartNumber. I am worried that someday, somewhere this line won't work because it does not have proper syntax.
I've tried escaping the various quote marks in this line, but that breaks the code.
Any suggestions?
Thanks!
$delivery = mysql_query("SELECT delivery_city FROM order_summaries WHERE order_number = '$_SESSION[CartNumber]'");
It works fine, but I believe that proper syntax would require a quote marks around the Session array key CartNumber. I am worried that someday, somewhere this line won't work because it does not have proper syntax.
I've tried escaping the various quote marks in this line, but that breaks the code.
Any suggestions?
Thanks!