AliceAmphetamine Posted January 16, 2010 Share Posted January 16, 2010 Trying to retrieve data from mysql doesn't seem like its retrieving all the info and also giving me an error. I read over a mysql data retrieval tutorial but it really didn't help much. I am guessing it is something with my $query but i tried adding all the fields into it and it still didn't work. What am I doing wrong? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/aliceamp/public_html/affhome.php on line 22 $query = "SELECT name FROM affiliates WHERE id = $info_id"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $info_sitename = $row['name']; $info_banner = $row['banner']; $info_url = $row['url']; $info_email = $row['email']; $info_in = $row['in']; $info_out = $row['out']; $info_datejoined = $row['date']; } Line 22 while($row = mysql_fetch_array($result, MYSQL_ASSOC)) Quote Link to comment Share on other sites More sharing options...
Buddski Posted January 16, 2010 Share Posted January 16, 2010 Your query did not execute correctly.. $result = mysql_query($query) or trigger_error(mysql_error()); will tell you why.. Quote Link to comment Share on other sites More sharing options...
Felex Posted January 16, 2010 Share Posted January 16, 2010 i want to add something... after you correct your query you will get other errors cause, you fetch only "name" field at your query but you use more fields like banner, url, email,... at your $row array variable.... 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.