Shiny_Charizard Posted February 13, 2008 Share Posted February 13, 2008 <?php include('top.php'); $username = $_SESSION["username"]; if(empty($username)) { echo "<TD class='table'> <center> <TABLE RULES='rows' WIDTH='580px'> <center><B>An Error has occured</B></center> <BR> <BR> You must be logged in to view this page.<br /><br /><a href='login.php'>Login</a>. </TABLE> <BR> <BR> </TD></center>"; } else { echo "<TD class='table'> <center> <TABLE RULES='rows' WIDTH='580px'> <center><B>Staff List</B></center> <BR> <BR> <TR> <TD CLASS='theadings'><CENTER><B>ID</B></CENTER></TD> <TD CLASS='theadings'><CENTER><B>Username</B></CENTER></TD> <TD CLASS='theadings'><CENTER><B>Position</B></CENTER></TD> </TR>"; $WebMasters2 = mysql_query("SELECT * FROM members WHERE trainer_position='<span style='color:blue;font-weight:bold;border:dotted 1px;'>Webmaster</span>'"); while($WebMasters = mysql_fetch_array($WebMasters2)) { echo "<TR> <TD CLASS='headings'><center>$WebMasters[user_id]</center></TD><TD CLASS='headings'><center><a href='profile.php?ID=$WebMasters[user_id]'>$WebMasters[username]</a></center></TD><TD CLASS='headings'><center>$WebMasters[trainer_position]</center></TD> </TR>"; } $Administrator2 = mysql_query("SELECT * FROM members WHERE trainer_position='<font color='red'>Administrator</font>'"); while($Administrator = mysql_fetch_array($Administrator2)) { echo "<TR> <TD CLASS='headings'><center>$Administrator[user_id]</center></TD><TD CLASS='headings'><center><a href='profile.php?ID=$Administrator[user_id]'>$Administrator[username]</a></center></TD><TD CLASS='headings'><center>$Administrator[trainer_position]</center></TD> </TR>"; } $SuperMod2 = mysql_query("SELECT * FROM members WHERE trainer_position='<font color='darkorange'>Super Moderator</font>'"); while($SuperMod = mysql_fetch_array($SuperMod2)) { echo "<TR> <TD CLASS='headings'><center>$SuperMod[user_id]</center></TD><TD CLASS='headings'><center><a href='profile.php?ID=$SuperMod[user_id]'>$SuperMod[username]</a></center></TD><TD CLASS='headings'><center>$SuperMod[trainer_position]</center></TD> </TR>"; } $BetaTester2 = mysql_query("SELECT * FROM members WHERE trainer_position='<span style='color:green'>Beta Tester</span>'"); while($BetaTester = mysql_fetch_array($BetaTester2)) { echo "<TR> <TD CLASS='headings'><center>$BetaTester[user_id]</center></TD><TD CLASS='headings'><center><a href='profile.php?ID=$BetaTester[user_id]'>$BetaTester[username]</a></center></TD><TD CLASS='headings'><center>$BetaTester[trainer_position]</center></TD> </TR>"; } echo "</TABLE> <BR> <center><small><i><font color='red'>Note:</font> Only members on this list are staff members. <br /> So if someone claims to be a staff member and they are not on this list they are not staff. <br /> We may accept gifted programmers for WebMaster. </i></small></center> <BR> </TD> </center>"; } include('bottom.php'); ?> Why do I keep getting these MySQL errors: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/tpfrpg/stafflist.php on line 34 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/tpfrpg/stafflist.php on line 41 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/tpfrpg/stafflist.php on line 48 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/tpfrpg/stafflist.php on line 55 I checked the code over and over again but I couldn't find the problem Please some one help me. Link to comment https://forums.phpfreaks.com/topic/90842-mysql-errors-help/ Share on other sites More sharing options...
teng84 Posted February 13, 2008 Share Posted February 13, 2008 use mysql scape sring.. or do this $x= mysql_escape_string("<font color=\'red\'>Administrator</font>"); $Administrator2 = mysql_query("SELECT * FROM members WHERE trainer_position='$x'"); Link to comment https://forums.phpfreaks.com/topic/90842-mysql-errors-help/#findComment-465601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.