MySQL Forums
Forum List  »  PHP

Re: How to pass variable to query in php?
Posted by: Rick James
Date: March 22, 2012 10:04PM

Interpolate, don't concatenate:
$query = "SELECT ... AND sfo.`increment_id` ='".$incrementid."';" -->
$query = "SELECT ... AND sfo.`increment_id` = '$incrementid'";
(Don't end SQL statements with a semicolon; do end PHP statements with a semicolon.)

Options: ReplyQuote


Subject
Written By
Posted
Re: How to pass variable to query in php?
March 22, 2012 10:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.