Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: code errors

  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    272
    Thanks
    63
    Thanked 1 Time in 1 Post

    code errors

    alright.. im back with another question. I have the following code:

    PHP Code:
    <?

    include ("config.php");


    $rank1 'http://www.money4every1.net/images/ranks/1.jpg';
    $rank2 'http://www.money4every1.net/images/ranks/2.jpg';
    $rank3 'http://www.money4every1.net/images/ranks/3.jpg';
    $rank4 'http://www.money4every1.net/images/ranks/4.jpg';
    $rank5 'http://www.money4every1.net/images/ranks/5.jpg';
    $rank6 'http://www.money4every1.net/images/ranks/6.jpg';
    $rank7 'http://www.money4every1.net/images/ranks/7.jpg';
    $rank8 'http://www.money4every1.net/images/ranks/8.jpg';
    $rank9 'http://www.money4every1.net/images/ranks/9.jpg';
    $user 'admin';

    $get_name mysql_query("SELECT * from `members` WHERE `username` = 'admin'");
     while(
    $namerow mysql_fetch_array($get_name))
          
    $offerscompleted $namerow["offerscompleted"];

                if(
    10 $offerscompleted && $offerscompleted 20) {
                      
    mysql_query("update members set avatarurl='$rank1' WHERE username='admin'");
    }
                if(
    20 $offerscompleted && $offerscompleted 30) {
                      
    mysql_query("update members set avatarurl='$rank2' WHERE username='admin'");
    }
                if(
    30 $offerscompleted && $offerscompleted 40) {
                      
    mysql_query("update members set avatarurl='$rank3' WHERE username='admin'");
    }
                if(
    40 $offerscompleted && $offerscompleted 50) {
                      
    mysql_query("update members set avatarurl='$rank4' WHERE username='admin'");
    }
                if(
    50 $offerscompleted && $offerscompleted 60) {
                      
    mysql_query("update members set avatarurl='$rank5' WHERE username='admin';");
    }
                if(
    60 $offerscompleted && $offerscompleted 70) {
                      
    mysql_query("update members set avatarurl='$rank6' WHERE username='admin'");
    }
                if(
    70 $offerscompleted && $offerscompleted 80) {
                      
    mysql_query("update members set avatarurl='$rank7' WHERE username='admin'");
    }
                if(
    80 $offerscompleted && $offerscompleted 90) {
                      
    mysql_query("update members set avatarurl='$rank8' WHERE username='admin'");
    }
                if(
    90 $offerscompleted && $offerscompleted 100) {
                      
    mysql_query("update members set avatarurl='$rank9' WHERE username='admin'");
    }

    ?>
    and instead of having it say "admin" in every line i tried to make it where it used $user instead, but it didn't work for some reason.. i got a blank page. this is what i tried:

    PHP Code:
    $user='admin';
                if(
    90 $offerscompleted && $offerscompleted 100) {
                      
    mysql_query("update members set avatarurl='$rank9' WHERE username='$user'");

    didnt seem to work.. any ideas?

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Oregon City
    Posts
    280
    Thanks
    5
    Thanked 50 Times in 49 Posts
    have u tried echoing out what offers completed actually is?

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    272
    Thanks
    63
    Thanked 1 Time in 1 Post
    i found a better way to do this. Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •