Jump to content
MakeWebGames

viewuser married status not working correctly? (FIXED)


Recommended Posts

Posted

ok im having little trouble with adding something on viewuser... i added

 

$m=$db->query("SELECT * FROM users WHERE userid='{$r['married']}'"); $par=$db->fetch_row($m);
if($ir['married'] != 0) { $partner= "[url='viewuser.php?u={$par[']<font color=yellow>{$par['username']}</font>[/url]"; } else { $partner= "<font color=red>N/A</font>"; }

 

under

 

if($r['donatordays'])  { $r['username'] = "<font color=gold>{$r['username']}</font>";$d="[img=donator.gif]"; }

 

then i added this

 

<td>
[b]<center>Married:[/b] $partner
</td></tr>";

 

("; is there because its at the bottom of the list, doesnt make any errors on my game) anyways....

i put it under

 

<tr>
<td>
[b]Crystals:[/b] {$r['crystals']}
</td></tr><tr>

 

it shows the people the 2 players are married to but... if i go on someone profile that isnt married it doesnt say

Married: N/A

anyone know why? hope you understand everything i just said in this post lol.

Posted

you might try this

[mysql]if($ir['married'] > 0)

{

print "<a href='viewuser.php?u={$par['userid']}'><font color=yellow>

{$par['username']}</font></a>";

}

else if($ir['married'] == 0)

{

print "<font color=red>N/A</font>";

}[/mysql]

where you have

[mysql]<td>

<center>Married: $partner

</td></tr>";

[/mysql]

Posted

that didnt work, thx for trying to help tho :)

i also changed that line i done to

 

$m=$db->query("SELECT * FROM users WHERE userid='{$r['married']}'"); $par=$db->fetch_row($m);
if($ir['married'] != 0) 
{ 
$partner= "[url='viewuser.php?u={$par[']<font color=yellow>{$par['username']}</font>[/url]"; 
} 
else if($ir['married'] == 0) { $partner= "<font color=red>N/A</font>"; 
}

 

but that didnt work nether... i guess its probably just my game...

Posted

friggen flight delayed again. lol stuck in another airport

 

but i cant see why

[mysql]$m=$db->query("SELECT FROM users WHERE userid='{$r['married']}'");

$par=$db->fetch_row($m);

if($ir['married'] > 0)

{

print "<a href='viewuser.php?u={$par['userid']}'><font color=yellow>

{$par['username']}</font></a>";

}

else if($ir['married'] == 0)

{

print "<font color=red>single and looking for some action</font>";

}

[/mysql]

is not working for ya bro. not 100% on the query to pull the info, but the last bit should show what your after.

Posted
$m = $db->query("SELECT `userid`, `username` FROM `users` WHERE `userid` = '{$r['married']}'");
$par = $db->fetch_row($m);
$married_text = ($ir['married'] != "0") ? "<font color=red>N/A</font>" : "[url='viewuser.php?u={$par[']<font color=yellow>{$par['username']} </font>[/url]" ;
 echo $married_text;

i don't see a single issue with that, is there?

Posted

i think i got it now...

 

if($r['donatordays'])  { $r['username'] = "<font color=gold>{$r['username']}</font>";$d="[img=donator.gif]"; }


$m=$db->query("SELECT * FROM users WHERE userid='{$r['married']}'"); 
$par=$db->fetch_row($m);
if($r['married'] > 0) 
{
$partner = "<a href='viewuser.php?u={$par['userid']}'><font color=yellow>
{$par['username']}</font></a>";
}
else if($r['married'] == 0)
{
$partner = "<font color=red>Nope</font>"; 
}

 

then i put

 

[b]<center>Married:[/b] $partner

 

where i wanted the text to appear.

 

the way i fixed it was by changing...

 

print "
into
$partner = "

 

if($ir['married'] > 0) 
into
if($r['married'] > 0)

 

else if($ir['married'] 
into 
else if($r['married']

 

on your first function you done Mcfarlin. :)

Posted
$m = $db->query("SELECT `userid`, `username` FROM `users` WHERE `userid` = '{$r['married']}'");
$par = $db->fetch_row($m);
$married_text = ($ir['married'] != "0") ? "<font color=red>N/A</font>" : "[url='viewuser.php?u={$par[']<font color=yellow>{$par['username']} </font>[/url]" ;
 echo $married_text;

i don't see a single issue with that, is there?

i think that would of worked if you had a sprintf fully modified viewuser but mine doesnt have any sprintf stuff in it. due to well idk how to code in that yet lol.

as when i tried that... i got an error about a t-string on line

$married_text = ($ir['married'] != "0") so i changed it into $married_text = ($ir['married'] != '0')

but then i got another error lol.

Posted
$married_text = ($ir['married'] != "0") so i changed it into $married_text = ($ir['married'] != '0')

i didn't say do that did i?

 

$m = $db->query("SELECT `userid`, `username` FROM `users` WHERE `userid` = '{$r['married']}'");
$par = $db->fetch_row($m);
$married_text = ($ir['married'] == "0") ? "<font color='red'>N/A</font>" : "[url='viewuser.php?u={$par[']<font color='green'>{$par['username']} </font>[/url]" ;
 echo "Married: {$married_text}";

 

Sorry about that noticed a issue

Posted

no you didnt tell me to do that, but that was the problem i had because of them two " " i got an error but after that i got another error. lol.

but its all fixed now finally :)

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