MrPen Posted July 14, 2009 Share Posted July 14, 2009 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!! Quote Link to comment https://forums.phpfreaks.com/topic/165874-sql-select-var-working-in-ff-but-not-in-ie/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 14, 2009 Share Posted July 14, 2009 What does $_POST['location'] come from? It is probably invalid HTML. Quote Link to comment https://forums.phpfreaks.com/topic/165874-sql-select-var-working-in-ff-but-not-in-ie/#findComment-874947 Share on other sites More sharing options...
MrPen Posted July 14, 2009 Author Share Posted July 14, 2009 Thanks for responding! $_POST['location'] grabs the value of the drop down combo box from the previous form and passes it to this page. Again, it displays the value of $_POST['location'] in a header tag, but it doesn't work in the SQL select when viewed in ie. Quote Link to comment https://forums.phpfreaks.com/topic/165874-sql-select-var-working-in-ff-but-not-in-ie/#findComment-875224 Share on other sites More sharing options...
anthylon Posted July 25, 2009 Share Posted July 25, 2009 Well do right click and see source code from IE. You should see your information from database. You probably have broken HTML and your data is not visible. Quote Link to comment https://forums.phpfreaks.com/topic/165874-sql-select-var-working-in-ff-but-not-in-ie/#findComment-882579 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.