Jump to content
MakeWebGames

Recommended Posts

Posted

I'm trying to add this in my header, but no matter what I do, it just shows the first result. Could you take a look and tell me if there is anything wrong?

 

$vote = $db->query("SELECT list FROM votes WHERE userid = ".$ir['userid']." ");

if(mysql_num_rows($vote) != trpg)
{
echo "<font color='#FFFFFF'>You haven't voted at TopRPG today! Do it now!</font>

";
}
elseif(mysql_num_rows($vote) != twg)
{
echo "<font color='#FFFFFF'>You haven't voted at TopWebGames today! Do it now!

";
}
elseif(mysql_num_rows($vote) != tpg)
{
echo "<font color='#FFFFFF'>You haven't voted at TopRankinGames today! Do it now!

";
}
elseif(mysql_num_rows($vote) != apex)
{
echo "<font color='#FFFFFF'>You haven't voted at Apex today! Do it now!

";
}
else
{
echo "<font color='#FFFFFF'>You've already voted today.

";
}

Posted

Re: voting help

as BD23 said... mysql_num_rows() will only return 1/2/3/whatever rows there are or FALSE, if you need to check for certain fields (hint: trpg(voting site)) you need at least the mysql_fetch_array(), my advice... check what is what and go from there!

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.   Paste as plain text instead

  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...