This is a discussion on problem with db function php within the alt.comp.lang.php forums, part of the PHP Programming Forums category; hi echo '<table>'; $requete = mysql_query("SELECT liv_nolivre, sec_nosection, liv_commentaire, liv_titre FROM livre"); if ( mysql_num_rows($requete) != 0 ) { ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hi
echo '<table>'; $requete = mysql_query("SELECT liv_nolivre, sec_nosection, liv_commentaire, liv_titre FROM livre"); if ( mysql_num_rows($requete) != 0 ) { while ($requete = mysql_fetch_assoc($requete)) { echo'<tr class="tabtitre"><td>'.$requete["liv_titre"].'</td></tr>', '<tr><td>'.$requete["liv_commentaire"].' </td></tr>'; } } echo '</table>'; i get: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource any idea? maybe my echo is not good? -- Borland rulez http://pages.infinit.net/borland |
|
|||
|
"Marc Collin" <os2@videotron.ca> wrote in message
news:8eGjc.69832$Tu2.1587055@weber.videotron.net.. . > hi > > echo '<table>'; > $requete = mysql_query("SELECT liv_nolivre, sec_nosection, > liv_commentaire, liv_titre FROM livre"); > > > if ( mysql_num_rows($requete) != 0 ) > { > while ($requete = mysql_fetch_assoc($requete)) { Here you replaced your result set with an array. $requete is being assigned. - Virgil |