Skip navigation links

MySQL Forums :: PHP :: How to pass variable to query in php?


Advanced Search

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
How to pass variable to query in php? pratik kanawade 03/21/2012 02:12AM
Re: How to pass variable to query in php? Peter Brawley 03/21/2012 08:40AM
Re: How to pass variable to query in php? Rick James 03/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.