Working on a current project I have encountered a strange issue. I have an html page that performs an AJAX call to a php file, passing a variable. The php file creates a SQL query using this variable, generates an XML file, and returns the result.
On my webserver this all works fine. However, when moved to a Windows 2003 IIS (permanent home) server it breaks.
Observations thus far... This breaks on windows server:
$qry = "SELECT * FROM structure_name WHERE ID = $variable ORDER by ID ASC";
$results = mysql_query($qry);
This breaks on windows server:
$variable = 5;
$qry = "SELECT * FROM structure_name WHERE ID = $variable ORDER by ID ASC";
$results = mysql_query($qry);
This breaks on windows server:
$variable = 5;
$qry = "SELECT * FROM structure_name WHERE ID = " + $variable + "ORDER by ID ASC";
$results = mysql_query($qry);
This works:
$qry = "SELECT * FROM structure_name WHERE ID = 5 ORDER by ID ASC";
$results = mysql_query($qry);
So, it appears the the server does not like a variable to be included in the query string. Any suggestions?