CrownVictoriaCop Posted February 21, 2010 Share Posted February 21, 2010 Hey Guys, I'm currently coding a script for a driving school. I programmed the code below, which goes on their homepage. They have two different locations, so I created the script below, which displays the class schedule for the two locations in a single table. Unfortunately, it is not displaying all of my test values. I have three test entries for when location is set to "27th" and four test entries for when location is set to "greenfieldhs", but it's only displaying three entries per variable. Can someone please take a look at this and see what's going on? Thanks! Anthony <table width="100%" border="0" align="center"> <tr> <td colspan="2" class="tablehead" width="50%" align="center">Milwaukee (27th Street)</td> <td colspan="2" class="tablehead" width="50%" align="center">Greenfield High School</td> </tr> <?php include 'db.php'; $query="SELECT * FROM classes WHERE location='27th'"; $query2="SELECT * FROM classes WHERE location='greenfieldhs'"; $result=mysql_query($query); $result2=mysql_query($query2); $num=mysql_numrows($result); $num2=mysql_numrows($result2); mysql_close(); ?> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"date"); $f2=mysql_result($result,$i,"time"); $f3=mysql_result($result2,$i,"date"); $f4=mysql_result($result2,$i,"time"); ?> <tr> <td width="30%" class="tablecontent"><?php echo $f1; ?></td> <td width="20%" class="tablecontent"><?php echo $f2; ?></td> <td width="30%" class="tablecontent"><?php echo $f3; ?></td> <td width="20%" class="tablecontent"><?php echo $f4; ?></td> </tr> <?php $i++; } ?> </table> Quote Link to comment Share on other sites More sharing options...
alpine Posted February 21, 2010 Share Posted February 21, 2010 $num=mysql_numrows($result); $num2=mysql_numrows($result2); $num=mysql_num_rows($result); $num2=mysql_num_rows($result2); Quote Link to comment Share on other sites More sharing options...
CrownVictoriaCop Posted February 21, 2010 Author Share Posted February 21, 2010 $num=mysql_numrows($result); $num2=mysql_numrows($result2); $num=mysql_num_rows($result); $num2=mysql_num_rows($result2); What am I supposed to do with these? Edit: I changed the code to that, but I am still having the same problem. Quote Link to comment 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.