Hey everyone, I've recently added gang pics to my game. They work, except they won't show up on the page where you view the gangs. I'm not exactly sure why it happens, as I thought it'd be an easy copy/paste from the yourgang.php (where the pic does show)
yourgang.php (where the pic works)
$gangdata = $db->fetch_row($gq);
$db->free_result($gq);
echo "
<h3><u>Your Guild - {$gangdata['gangNAME']}</u></h3>
";
if($gangdata['gangPIC'])
{
print "<img src='{$gangdata['gangPIC']}' alt='Gang Picture' width='350' height='350' />";
}
else
{
print " ";
}
Can be seen working here...
This is the code on gangs.php, where it doesn't show.
function gang_view()
{
global $db, $ir, $c, $h, $gangdata;
$gangPIC = $db->query(
"SELECT `gangPIC`
FROM `gangs`
WHERE `gangID` = {$gangdata['gangID']}");
$pq =
$db->query(
"SELECT `userid`, `username`
FROM `users`
WHERE `userid` = {$gangdata['gangPRESIDENT']}
LIMIT 1");
if ($db->num_rows($pq) == 0)
{
$ldr = array('userid' => 0);
}
else
{
$ldr = $db->fetch_row($pq);
}
$db->free_result($pq);
$vpq =
$db->query(
"SELECT `userid`, `username`
FROM `users`
WHERE `userid` = {$gangdata['gangVICEPRES']}");
if ($db->num_rows($vpq) == 0)
{
$coldr = array('userid' => 0);
}
else
{
$coldr = $db->fetch_row($vpq);
}
$db->free_result($vpq);
echo "<h3><u>{$gangdata['gangNAME']} Guild</u></h3><hr />";
if($gangdata['gangPIC'])
{
print "<img src='{$gangdata['gangPIC']}' alt='Gang Picture' width='468' height='60' /><hr />";
}
else
{
print "<b>No Gang Picture</b><hr />";
}
if ($ldr['userid'] > 0)
{
print
"Founder: <a href='viewuser.php?u={$ldr['userid']}'>{$ldr['username']}</a><br />";
}
else
{
print "Founder: N/A<br />";
}
if ($coldr['userid'] > 0)
{
print
"Co-Founder: <a href='viewuser.php?u={$coldr['userid']}'>{$coldr['username']}</a><hr />";
}
else
{
print "Co-Founder: N/A<hr />";
}
$cnt =
$db->query(
"SELECT COUNT(`userid`)
FROM `users`
WHERE `gang` = {$gangdata['gangID']}");
echo "<b>Members:</b> " . $db->fetch_single($cnt)
. "<br />
<b>Description: </b> {$gangdata['gangDESC']}<br />
<b>Respect Level: </b> {$gangdata['gangRESPECT']}<br />
> <a href='gangs.php?action=userlist&ID={$gangdata['gangID']}'>
User List
</a><br />
> <a href='gangs.php?action=apply&ID={$gangdata['gangID']}'>
Apply
</a>";
$db->free_result($cnt);
}
Can be seen that its not working
I also get this error with the error reporting working. (On gang.php)
A non-critical error has occurred. Page execution will continue. Below are the details:
PHP Notice: Undefined index: gangPIC (8)
Line executed: /home/chivalr2/public_html/gangs.php:108
Can anyone tell me what I've done wrong?