LightningSt Posted June 6, 2008 Share Posted June 6, 2008 I have no idea whats wrong but this automatically generates a table based on information from the database... but when you have two appointments scheduled it freaks out... i currently only have two appointments scheduled int he database and here is what happens The first row is generated properly... nothing wrong but on the second row, whether it is a different contact or not, the contact portion has a heart attack... it will still echo the name but it gives off this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\HUGO\appointments.php on line 79 Here are lines 78-80 and the entire feature is below that $resultses = mysql_query("SELECT * FROM ci WHERE ID = '$CI'"); while ($row = mysql_fetch_array($resultses,MYSQL_ASSOC)) { <table width="100%" border="2"> <tr> <td> Contact Name </td> <td> From </td> <td> Till </td> <td> YYYY-MM-DD </td> <td> Action </td> </tr> <?php include 'library/configdb.php'; include 'library/opendb.php'; $resulting = mysql_query("SELECT * FROM appointment"); while ($row = mysql_fetch_array($resulting,MYSQL_ASSOC)) { $CI = $row['CIN']; $start = $row['Start']; $end = $row['Ends']; $date = $row['Date']; ?> <form method="POST" action="?res=1"> <tr> <td> <?php $resultses = mysql_query("SELECT * FROM ci WHERE ID = '$CI'"); while ($row = mysql_fetch_array($resultses,MYSQL_ASSOC)) { $title = $row['title']; $first = $row['first']; $last = $row['last']; } echo $title.' '.$first.' '.$last; ?> <input type="hidden" name="hiddens" value="<?php echo $CI; ?>"> </td> <td> <?php echo $start; ?> </td> <td> <?php echo $end; ?> </td> <td> <?php echo $date; ?> </td> <td> <select name="action"> <option value="Yes">Showed For Appointment</option> <option value="No">Did Not Show for Appointment</option> </select> </td> <td> <input type="submit" value="Attended"> </td> </tr> </form> <?php include 'library/closedb.php'; } ?> </table> Quote Link to comment https://forums.phpfreaks.com/topic/108934-mysql-fetch-array/ Share on other sites More sharing options...
LightningSt Posted June 6, 2008 Author Share Posted June 6, 2008 Uhg.... The moment I hit post I figured it out... please disregard... Thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/108934-mysql-fetch-array/#findComment-558869 Share on other sites More sharing options...
.josh Posted June 6, 2008 Share Posted June 6, 2008 fyi, doing mysql_fetch_array($blah, MYSQL_ASSOC) is the same as doing mysql_fetch_assoc ($blah) _assoc returns associative array _row returns a numerical array _array returns both without a 2nd argument, and one or the other with a 2nd argument Quote Link to comment https://forums.phpfreaks.com/topic/108934-mysql-fetch-array/#findComment-558886 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.