simcoweb Posted September 5, 2006 Share Posted September 5, 2006 On this page: [url=http://www.highlandbluffsresort.com/phase-two.php]http://www.highlandbluffsresort.com/phase-two.php[/url] the first item in the list of lots should be Lot #2. Instead it's showing Lot#3 as the first item. When I view the database in PHPMyAdmin it clearly shows lot #2 as the first row. I can't understand why it doesn't show in the posted results in the page. Here's the code:[code]$sql=("SELECT * FROM phase_two");$results=mysql_query($sql);$row = mysql_fetch_row($results);$num_rows = mysql_num_rows($results);if ($num_rows == 0) {echo "<font class='bodytext'><center>We are sorry. The lot information is unavailable at this time.<br /> Please contact us for details on available lots.<br />";} else {echo " <table width='700' border='0' align='center' onMouseover=\"changeto(event, 'darkkhaki')\" onMouseout=\"changeback(event, 'lightgoldenrodyellow')\"> <tr> <th><font face=\"Verdana\" size=\"2\">Lot #</th> <th><font face=\"Verdana\" size=\"2\">Sq. Ft.</th> <th><font face=\"Verdana\" size=\"2\">Street</th> <th><font face=\"Verdana\" size=\"2\">Frontage</th> <th><font face=\"Verdana\" size=\"2\">Location</th> <th><font face=\"Verdana\" size=\"2\">View</th> <th><font face=\"Verdana\" size=\"2\">Acres</th> <th><font face=\"Verdana\" size=\"2\">Price</font></th> <th><font face=\"Verdana\" size=\"2\"> </th> </tr>"; while ($a_row = mysql_fetch_array( $results )) { echo " <tr bgcolor=\"lightgoldenrodyellow\"> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['lot'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['sq_feet'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['street'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['frontage'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['location'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['view'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">" . $a_row['acres'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\">\$" . $a_row['sale_price'] . "</td> <td style=\"text-align: center;\"><font face=\"Verdana\" size=\"1\"><a href=\"contact-p2.php?id=" . $a_row['lot'] . "\">Contact</a></td> </tr>"; }print "</table>\n";echo "<br>"; }//print "</table>\n";[/code]I can't see anything here that would tell it to ignore row 1 of the table. Ideas? Link to comment https://forums.phpfreaks.com/topic/19809-first-row-of-data-is-not-showing-up/ Share on other sites More sharing options...
Barand Posted September 5, 2006 Share Posted September 5, 2006 $sql=("SELECT * FROM phase_two");$results=mysql_query($sql);[color=red]$row = mysql_fetch_row($results);[/color]That line reads first row and throws it away Link to comment https://forums.phpfreaks.com/topic/19809-first-row-of-data-is-not-showing-up/#findComment-86661 Share on other sites More sharing options...
simcoweb Posted September 5, 2006 Author Share Posted September 5, 2006 Thanks, Barand. That speck of code wasn't even necessary since the $row variable wasn't being used. I commented it out and the script is now producing the display of all the data rows. Link to comment https://forums.phpfreaks.com/topic/19809-first-row-of-data-is-not-showing-up/#findComment-86676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.