Jump to content

Members only script


CammyD

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.