Howdy, Stranger!

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

Categories

Why does this yield "0"?

KrelianKrelian Member Posts: 10
[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...




Comments

  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    ________ // http://forcoder.org // free video tutorials and ebooks about // Java C MATLAB JavaScript Swift Visual Basic Ruby Go PL/SQL Delphi Scratch C++ R C# PHP Visual Basic .NET Objective-C Assembly Python Perl Lisp ML Clojure Bash Apex Hack Alice Julia FoxPro Crystal LabVIEW Dart Rust Awk Scala Erlang Scheme SAS Kotlin Logo Transact-SQL Fortran F# Ada COBOL Lua VBScript Prolog ABAP D // ______

Sign In or Register to comment.