CammyD Posted March 2, 2008 Share Posted March 2, 2008 Hey guys. Once again i need your help with a project. I am trying to create a little site for my mountain biking club. I have got most of the code sussed out, but there is a problem with my members script. On the main page i want it to say "You have not payed this month" if you user level is 1. I am using this code for it: foreach ($data as $words) { print ""; print $words; print '</a>, '; echo $words; $data = mysql_query("SELECT * FROM users WHERE username='$keyword'") or die(mysql_error()); if ( $data = "one" ) { echo "You have not payed this month"; } An whenever i load up the page, i get this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Projects\admin\index.php on line 62 Link to comment https://forums.phpfreaks.com/topic/93930-members-only-script/ Share on other sites More sharing options...
trq Posted March 2, 2008 Share Posted March 2, 2008 Missing ; from this.... $data = mysql_query("SELECT * FROM users WHERE username='$keyword'") line. Link to comment https://forums.phpfreaks.com/topic/93930-members-only-script/#findComment-481280 Share on other sites More sharing options...
CammyD Posted March 2, 2008 Author Share Posted March 2, 2008 SORRY GUYS, FIXED IT Link to comment https://forums.phpfreaks.com/topic/93930-members-only-script/#findComment-481282 Share on other sites More sharing options...
CammyD Posted March 2, 2008 Author Share Posted March 2, 2008 Missing ; from this.... $data = mysql_query("SELECT * FROM users WHERE username='$keyword'") line. Thanks. The problem was that i had the code messed up. The if bit was in the middle of the mysql query. I am a dumbass Link to comment https://forums.phpfreaks.com/topic/93930-members-only-script/#findComment-481283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.