Ikz786 Posted July 23, 2013 Share Posted July 23, 2013 I purchased a marriage mod and I want the name of the person I'm married to, to show up on my profile. I've followed the instructions given with the mod but I can't figure it out where the problem is. $m = $db->fetch_row($db->query(sprintf("SELECT u.userid, u.username, u.money, u.crystals, u.bankmoney, u.cybermoney, u.maxwill, u.marriedwill, us.*, h.hNAME, h.hWILL FROM users AS u LEFT JOIN userstats AS us ON u.userid=us.userid LEFT JOIN houses AS h ON u.maxwill=h.hWILL WHERE u.userid=%u", $r['married']))); That is the code which fetches the information from the database, but when it comes to printing that information it comes up as "Married to: []" when it should be "Married to: User [1]" for example. The code to print this is: <b>Married To: </b>"; if($ir['married'] > 0) { print"<a href='viewuser.php?u={$m['userid']}'>{$m['username']} [{$m['userid']}]</a>"; } else { print"Nobody"; } Can somebody help me please as I don't know what the problem is. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted July 23, 2013 Share Posted July 23, 2013 Try this: <b>Married To: </b>"; if($r['married'] > 0) { print"<a href='viewuser.php?u={$m['userid']}'>{$m['username']} [{$m['userid']}]</a>"; } else { print"Nobody"; } Also it helps if you go to the person you purchased this from for support Quote Link to comment Share on other sites More sharing options...
Dragon Blade Posted July 23, 2013 Share Posted July 23, 2013 Try this. print "Marital Status: "; if ($r['married'] > 0) { $part=mysql_query("SELECT * FROM users WHERE userid={$r['married']}"); $pr=mysql_fetch_array($part); print "Married to <a href='viewuser.php?u={$pr['userid']}'>{$pr['username']}</a> for {$pr['married_days']} days<br />"; } else { print "Single<br />"; } Quote Link to comment Share on other sites More sharing options...
Ikz786 Posted July 23, 2013 Author Share Posted July 23, 2013 Both of the above didn't work, they came up as single or not married when I was married, but I managed to fix it myself, thanks for trying. Quote Link to comment Share on other sites More sharing options...
Ikz786 Posted July 23, 2013 Author Share Posted July 23, 2013 Wait no its not fixed -.- this only shows who I'm married to, so if I go on someone else's profile, it will only show who I am married to not who they are married to :/ I checked it on my own profile and it seemed to work but I realised it was a mistake when I went on someone else's profile and saw it said the person I am married to, on their profile. Now, I tried contacting the person I purchased the mod off and he said it should work fine even after asking him many times that it doesn't work. Still need help :( Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted July 23, 2013 Share Posted July 23, 2013 you must be using the $ir variable Quote Link to comment Share on other sites More sharing options...
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.