A newbie to PHP and after searching all over for a solution, I'm at my wits end. I have a LAMP server with the latest versions of PHP/APACHE. Using a drop-down list from a leading post form page, I'm loading data from a separate MS SQL 2000 database server to display into a table. However, the data loads fine in Firefox, but not in IE 6,7, nor 8. The select loads data filtered by the 'location' column. The $loc var prints fine in the header tag, but does not work in the select. The result is table headers with no records. If I replace the $loc var with actual data, it works. I've tried many variations of syntax for the $loc var but to no avail. Here is the section of code with the select in question:
//Connect to the MS SQL database
$dbconnect = mssql_connect($server, $un, $pw);
$dbselect = mssql_select_db($db,$dbconnect);
if(!$dbselect)
{
die('Cannot connect to the database!');
}
//Get location from request form
$loc = $_POST['location'];
print "<p class=\"title\"><strong>" . $loc . "</strong></p>";
//Select records from the RSVP table
//$locescape = mysql_real_escape_string($loc);
$sql = "SELECT * FROM ersvp WHERE location='$loc' AND inputdt >= 'July 1, 2008'";
$rs = mssql_query($sql);
if (!$rs)
{
exit("Error in SQL");
}
//Set up data table header
echo "<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" width=\"800\"><tr>";
echo "<th>Customer No</th>";
echo "<th>Name</th>";
echo "<th>School</th>";
echo "<th>Date Registered</th></tr>";
//Display data records
while ($nt=mssql_fetch_array($rs))
{
echo "<td>" . $nt['schoolid'] . "</td>";
echo "<td>" . $nt['name'] . "</td>";
echo "<td>" . $nt['schoolname'] . "</td>";
echo "<td>" . $nt['inputdt'] . "</td></tr>";
}
echo "</table>";
Any help would be greatly appreciated!!