Jump to content
MakeWebGames

Display Gangs Name???


Mark F
 Share

Recommended Posts

Hello Everyone,

I wish to display the name of my gang on my index page.

I know that I have to add the following:

if($r['gang'])
{
print "[url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url]";
}
else
{
print "N/A";
}

Though how do I change the following code so I only have what I need?:

include "globals.php";
$_GET['u'] = abs((int) $_GET['u']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$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']}");
Link to comment
Share on other sites

Re: Display Gangs Name???

Add this to were the queries are:

 

$wq=$db->query("SELECT * FROM gangwars where warDECLARER={$ir['gang']} or warDECLARED={$ir['gang']}");
$gq=$db->query("SELECT * FROM gangs WHERE gangID={$_GET['ID']}");
$gangdata=$db->fetch_row($gq);
$gq=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangID={$ir['gang']}");
$gangdata=$db->fetch_row($gq);

 

Then add somewhere in Index.php:

 

if($ir['gang'])
{
print "
<u>Gang Info</u>

Your Gang: [url='gangs.php?action=view&ID={$ir[']<font color=green>{$ir['gangNAME']} ({$ir['gangID']})</font>[/url]

Your Gang Wars: <font color=red>".$db->num_rows($wq)." Wars</font>

Your Gang Respect: {$ir['gangRESPECT']}
";
}
else
{
print "<u>Gang Info</u>

Your not in a gang

";
}

 

Just thought of it, might not work but its worth a shot

Link to comment
Share on other sites

  • 1 month later...

Re: Display Gangs Name???

here is what i use and it works fine

$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.userid=$userid");
$g=$db->fetch_row($q);

 

[b]Gang:[/b] ";
if($g['gang'])
{
echo "[url='gangs.php?action=view&ID={$g[']{$g['gangNAME']}[/url]
";
} else {
echo "N/A
";
}
Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...