newttster Posted October 7, 2011 Posted October 7, 2011 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>"; Quote
prototype Posted October 7, 2011 Posted October 7, 2011 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']}'"); Quote
newttster Posted October 7, 2011 Author Posted October 7, 2011 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 /> Quote
Uridium Posted October 7, 2011 Posted October 7, 2011 or $rr=$db->query("SELECT * FROM referals WHERE refREFER='".$r[userid]."'"); Quote
lucky3809 Posted October 9, 2011 Posted October 9, 2011 in the staff create new player page there is a query look it over it doesn't insert the correct info. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.