Jump to content
MakeWebGames

Recommended Posts

Posted

When I add an NPC or another player I am getting an error message when I go to view that profile. The weird thing is it only does this when added via the staff page. If I add them through the normal register page they show up just fine. Any ideas?

Error messge: Referals: QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Query was SELECT * FROM referals WHERE refREFER=

 

 

Signed Up: $sup<br />
Last Active: $lon<br />
Last Action: $str<br />
Last Login: $str2<br />
Online: $on<br />
Days Old: {$r['daysold']}<br />
Location: {$r['cityname']}</td><td>
Money: {$fm}<br />
Crystals: {$r['crystals']}<br />
Property: {$r['hNAME']}<br />
Referals: ";
$rr=$db->query("SELECT * FROM referals WHERE refREFER={$r['userid']}");
print $db->num_rows($rr);
print "<br />
Marital Status: ";
if ($r['marriage'])
{
$part=$db->query("SELECT * FROM users WHERE userid={$r['marriage']}");
$pr=$db->fetch_row($part);
print "Married to <a href='viewuser.php?u={$pr['userid']}'>{$pr['username']}</a>";
}
else
{
print "Single";
}
print "<br />
Friends: {$r['friend_count']}<br />
Enemies: {$r['enemy_count']}
</td> <td>";
Posted

Dude instead of typing this code

$rr=$db->query("SELECT * FROM referals WHERE refREFER={$r['userid']}");

type this code

$rr=$db->query("SELECT * FROM referals WHERE refREFER='{$r['userid']}'");

Posted

Thanks. That worked. Any suggestions on why the ID of the player does not show.

 

if($r['laston'] >= time()-15*60) { $on="<font color=green><b>Online</b></font>"; } else { $on="<font color=red><b>Offline</b></font>"; }
print "<h3>Profile for {$r['username']}</h3>
<table width=100% cellspacing=1 class='table'><tr style='background:gray'><th>General Info</th><th>Financial Info</th> <th>Display Pic</th></tr>
<tr><td>Name: {$r['username']} [{$r['userid']}] $d<br />
User Level: $userl<br />
Duties: {$r['duties']}<br />
Gender: {$r['gender']}<br />
Signed Up: $sup<br />
Last Active: $lon<br />

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