thegod Posted May 30, 2007 Share Posted May 30, 2007 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in tops.php on line 33 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in tops.php on line 56 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in tops.php on line 76 i have point the lines out in red this is tops coding <? session_start(); include "includes/functions.php"; logincheck(); $username=$_SESSION['username']; include "includes/db_connect.php"; echo "$style"; ?> <center><html><head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100%" border="0" cellspacing="4" cellpadding="2"> <tr> <td width="274" height="122" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="#666666"> <tr> <td height="22" colspan="2" background="includes/grad.jpg"><center class="TableHeading"> <font color="#FFFFFF">Top 10 Ranks </center></td> </tr> <tr> <td width="127" height="10" valign="top"><b>Username</b></td> <td width="136" valign="top"><b>Rank</b></td> </tr> <center><?php $tsel = mysql_query("select * from `users` where `userlevel`='0' and `status`='alive' order by `rank` desc limit 10"); while ($top=mysql_fetch_array($tsel)) { line 36 print "<tr><td></center><a href=profile.php?viewuser=$top[username]>$top[username]</a></td><td align=right>$top[rank]</td></tr>"; } ?> </table> <br> <br> <table width="100%" border="0" cellspacing="2" cellpadding="0" align="center"> <tr> <td width="200%" height="122" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="#666666"> <tr> <td height="22" colspan="2" background="includes/grad.jpg"><center class="TableHeading"> <font color="#FFFFFF">10 Richest Players </center></td> </tr> <tr> <td width="127" height="10" valign="top"><b>Username</b></td> <td width="136" valign="top"><b>Rank</b></td> </tr> <?php $tsel = mysql_query("select * from `users` where `userlevel`='0' and `status`='alive' order by `money` desc limit 10"); while ($top = mysql_fetch_array($tsel)) { Line 56 print "<tr><td><a href=profile.php?viewuser=$top[username]>$top[username]</a></td><td align=right>$top[rank]</td></</tr>"; } ?> </table> <table width="100%" border="0" cellspacing="4" cellpadding="2"> <tr> <td width="274" height="122" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="#666666"> <tr> <td height="22" colspan="2" background="includes/grad.jpg"><center class="TableHeading"> <font color="#FFFFFF">Top 10 Forum Posters </center></td> </tr> <tr> <td width="127" height="10" valign="top"><b>Username</b></td> <td width="136" valign="top"><b>Posts</b></td> </tr> <center><?php $tsel = mysql_query("select * from `users` where `userlevel`='0' and `status`='alive' order by `posts` desc limit 10"); while ($top = mysql_fetch_array($tsel)) { line 76 print "<tr><td></center><a href=profile.php?viewuser=$top[username]>$top[username]</a></td><td align=right>$top[posts]</td></tr>"; } ?> </table> <br> <br> </td> </table> </body> </html></center> Quote Link to comment https://forums.phpfreaks.com/topic/53528-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql/ Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 Change your $tsel = mysql_query("..."); to $tsel = mysql_query("...") or die(mysql_error()); This makes sure that your queries are running correctly, which is the most likely fault. Quote Link to comment https://forums.phpfreaks.com/topic/53528-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql/#findComment-264540 Share on other sites More sharing options...
thegod Posted May 30, 2007 Author Share Posted May 30, 2007 cheers will do Quote Link to comment https://forums.phpfreaks.com/topic/53528-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql/#findComment-264542 Share on other sites More sharing options...
thegod Posted May 30, 2007 Author Share Posted May 30, 2007 worked 10/10 cheers mate Quote Link to comment https://forums.phpfreaks.com/topic/53528-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql/#findComment-264543 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.