Jump to content

padams

Members
  • Posts

    105
  • Joined

  • Last visited

    Never

Everything posted by padams

  1. Brilliant, solved it. Thanks, I really should have thought of that myself...
  2. I need to display the results of a query twice on one page and have run into a problem. I have used mysql_data_seek at the end of the first do while loop, setting the internal pointer back to 0, but when I echo out the results a second time I get a blank record at the top. You can see the results on a test page at http://elsombrero.stacnz.com/testing.php, the code is: $courses_sql = "SELECT * FROM courses"; $courses_query = mysql_query($courses_sql) or die(mysql_error()); $rsCourses = mysql_fetch_assoc($courses_query); <ul><?php do { ?> <li><a href="menu.php?courseID=<?php echo $rsCourses['courseID']; ?>"> <?php echo $rsCourses['cName']; ?> </a></li> <?php } while ($rsCourses = mysql_fetch_assoc($courses_query)); mysql_data_seek($courses_query, 0); ?> <?php do { ?> <li><a href="menu.php?courseID=<?php echo $rsCourses['courseID']; ?>"> <?php echo $rsCourses['cName']; ?> </a></li> <?php } while ($rsCourses = mysql_fetch_assoc($courses_query)); mysql_data_seek($courses_query, 0); ?></ul> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.