Why does this yield "0"?

[b][red]This message was edited by the Krelian at 2002-7-16 15:24:20[/red][/b][hr]
[b][red]This message was edited by the Krelian at 2002-7-16 14:31:7[/red][/b][hr]
Anyone who has used a Vbulletin will understand what I am doing. I run a game based forum, and decided to add some fun stuff to it. This is part of the hack that I added to the index:
[code]
$relicuser = $DB_site->query_first("SELECT user.relic, shop_relics.effect AS reffect, shop_relics.special AS relicspecial FROM user
LEFT JOIN shop_relics ON shop_relics.id = user.relic
WHERE userid='$bbuserinfo[userid]'");
if ($relicuser['reffect']== 0){
$relicplus = $relicuser[relicspecial];
}else{
$relicplus = "0";
}
if ($bbuserinfo[usergroupid] == 6){
$userspostmulti1 = (pow (log10 (($bbuserinfo[posts])*1.15), 3));
$userspostmulti = floor($userspostmulti1 + $relicplus);
}else{
$userspostmulti1 = (pow (log10 ($bbuserinfo[posts]), 3));
$userspostmulti = floor($userspostmulti1 + $relicplus);
}

$DB_site->free_result($relicuser);

$grandtotal=$DB_site->query("SELECT user.*,shop_relics.effect AS reffect, shop_relics.special AS relicspecial FROM user
LEFT JOIN shop_relics ON shop_relics.id = user.relic");
while ($ultimatenumbers=$DB_site->fetch_array($grandtotal)){
if ($ultimatenumbers['reffect'] ==0){
$relicplus2 = $ultimatenumbers[relicspecial];
}else{
$relicplus2 = "0";
}

if ($ultimatenumbers['usergoupid'] == 6){
$othermemberspostmulti1= (pow (log10 ($ultimatenumbers[posts]*1.15), 3));
$othermemberspostmulti = floor($othermemberspostmulti1 + $relicplus2);
}else{
$othermemberspostmulti1= (pow (log10 ($ultimatenumbers[posts]), 3));
$othermemberspostmulti = floor($othermemberspostmulti1 + $relicplus2);
}
}
$DB_site->free_result($grandtotal);
[/code]
The purpose is to determine who is at a higher level than yourself. However, I cannote get the second part to work, with the otherusers. It always yields Zero. I am new to php programming, and would greatly appreciate it if anyone can help me out with this...




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories