<?php
include "globals.php";
$_GET['u'] = abs((int) $_GET['u']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{ // suggestion :- you can remove userstats ,cities, fed and gang from the query bcz you are not using em
$_GET['u'] = mysql_real_escape_string($_GET['u'], $link)
$q=$db->query("SELECT u.*,us.*,c.*,h.*,g.*,f.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN cities c ON u.location=c.cityid LEFT JOIN houses h ON u.maxwill=h.hWILL LEFT JOIN gangs g ON g.gangID=u.gang LEFT JOIN fedjail f ON f.fed_userid=u.userid WHERE u.userid={$_GET['u']}");
if($db->num_rows($q) == 0)
{
print "Sorry, we could not find a user with that ID, check your source.";
}
else
{
if($ir['DailyVote'] == False)
{
$r = mysql_fetch_array($q);
$db->query("UPDATE `users` SET DailyVote = 'True' WHERE `userid` = &ir['userid']");
$db->query("UPDATE `users` SET upvotes=upvotes+1 WHERE `userid` = &r['userid']");
print "You have up voted the player!";
}
else
{
print "You may only vote once per day.";
}
}
}
$h->endpage();
?>
hope it will help you