leequalls Posted October 25, 2010 Share Posted October 25, 2010 Not sure what I am doing wrong: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /public_html/lq/index.php on line 12 $schedule = "LQ"; include('/public_html/en/header_staff.php'); include("connect.php"); $page = $_SERVER["SERVER_NAME"]; $who = explode(".", $page); $sql = "select * from rp_staff WHERE schedule = $schedule"; $rpstaff = mysql_query($sql); while ($row = mysql_fetch_assoc($rpstaff)) { $alt = $row['dj']; $name = $row['name']; $city = $row['city']; $state = $row['state']; $country = $row['country']; $artists = $row['artists']; $about = $row['about']; $genre = $row['genrev']; $position = $row['position']; } Quote Link to comment Share on other sites More sharing options...
revraz Posted October 25, 2010 Share Posted October 25, 2010 Your SQL is failing, so your $rpstaff variable is empty. Try to use error checking on all querries, it will save you headaches. $rpstaff = mysql_query($sql) or die ('Error in query: $sql. ' . mysql_error()); Quote Link to comment Share on other sites More sharing options...
leequalls Posted October 25, 2010 Author Share Posted October 25, 2010 thanks here is the error Error in query: $sql. Unknown column 'LQ' in 'where clause' Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 25, 2010 Share Posted October 25, 2010 WHERE schedule = '$schedule'"; Quote Link to comment Share on other sites More sharing options...
leequalls Posted October 25, 2010 Author Share Posted October 25, 2010 thanks for the help that was a silly fix 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.