Jump to content
MakeWebGames

advanced warning system????


iR00T

Recommended Posts

ok i add'd it right upload warnings.php did that put it in users this

$w=$db->query("SELECT * FROM warnings WHERE user={$r['userid']}");print "<font color=red>Warnings: ".$db->num_rows($w)." </font>";if($ir['user_level'] > 1){print "|| [<a href=warnings.php?action=index&user={$r['userid']}>Manage</a>]";}

 

with days old above it still gave me a error on the viewusers when i click on my game wtf could someone give me a working warnings mod????

pm me plz

Link to comment
Share on other sites

Guest Anonymous

Re: advanced warning system????

Do tell us what the error is ... I can't quite my crystal ball ;)

 

$w=$db->query("SELECT * FROM warnings WHERE user={$r['userid']}");
print "<font color=red>Warnings: ".$db->num_rows($w)." </font>";
if($ir['user_level'] > 1)
   print "|| [<a href=warnings.php?action=index&user={$r['userid']}>Manage</a>]";
Link to comment
Share on other sites

Re: advanced warning system????

Nyna remmember quite a few weeks ago you said you do not require quotation's for numbers?

Well recently i discovered in some places you need them.

 

$fetch_data = mysql_query("SELECT * FROM warnings WHERE user='".$r['userid']."'") or die(mysql_error());
echo '<font color="red">[b]Warnings:[/b] '.mysql_num_rows($fetch_data).'</font>';
if($ir['user_level'] > 1)
{
   echo ' ||[url="warning.php?action=index&user='.$r['userid'].'"]Managae[/url]]';
}
Link to comment
Share on other sites

Guest Anonymous

Re: advanced warning system????

Sorry to dissapoint you there old bean ... wrong again... You do not need the the quotation marks around that.

Had you been paying a little more attention, you may have noticed a security bulletin which although currently aimed at Oracle users, may have some future bearing on MySQL users regarding the quoting of numeric values.

Link to comment
Share on other sites

Re: advanced warning system????

Well i dont know i read this one forum and it says that quotation marks are needed in some occasions, with numbers.

Well since you said it was not needed, i went and did a little test. By using some thing like

 

$fetch_data = mysql_query("SELECT * FROM users WHERE location={$r['location']}") or die(mysql_error());

 

It gave me an error. So i tried this

 

$fetch_data = mysql_query("SELECT * FROM users WHERE location=$r['location']") or die(mysql_error());

 

Gave me another error. So eventualy i just went with my code

 

$fetch_data = mysql_query("SELECT * FROM users WHERE location='".$r['location']."'") or die(mysql_error());

 

And it never gave me no error.

Maybe on your machine quotation marks are not needed or your php version or what so ever, but on my host it is required in some occasions.

Link to comment
Share on other sites

Re: advanced warning system????

And to get us back on topic...

Joker, don't throw random code at us! Give us around 5-10 lines of code above and below what it is you want.

Also - I have fixed this for him. But yea - in future let us know what it is that's causing the error too!

Link to comment
Share on other sites

  • 1 month later...

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