Closed Thread
Results 1 to 4 of 4




  

Thread: need quick php help

      
  1. #1
    Jedi Master bikerboys is on a distinguished road
    Join Date
    August 29, 2007
    Location
    usa
    Posts
    25
    Rep Power
    5
    Feedback Score
    0

    Default need quick php help

    i have levels i use in a game of mine it goes per credits added and supporter status in the game everything is working except for level 3 when they added more then 99999 credits addeding more then 99999 credits gives you level 4 in the game but they cant reach level 4 unless they are a supporter so i need to keep them in level 3 level 3 works but only if they didnt add 99999 credit hope you under stand
    any help would be great

    here is the code im working with

    PHP Code:
    if(!$l)
    {
     if(
    $creditz[0]==0||$tmp_rows==0)
      
    $lvl=1;
     else if(
    $creditz[0]<40001&&$creditz[0]>0)
      
    $lvl=2;
     else if(
    $creditz[0]<100000&&$creditz[0]>40000)
      
    $lvl=3;
     else if(
    $creditz[0]>99999)
      
    $lvl=4;
    }
    else
    {
     
    $lvl=$l;
    }
    if(
    $lvl==1)
     
    $lvlstring="stats.credits=0";
    else if(
    $lvl==2)
     
    $lvlstring="stats.credits<40001 AND stats.credits>0";
    else if(
    $lvl==3)
     
    $lvlstring="stats.credits<100000 AND stats.credits>40000";
    else if(
    $lvl==4)
     
    $lvlstring="stats.credits>99999 AND $tab[pimp].status='Supporter'";
     
    $sSQL "SELECT count(*) FROM users, stats,$tab[pimp] WHERE users.username = stats.user AND $tab[pimp].code=users.code AND $tab[pimp].networth>'$pmpz[1]' AND stats.round='$round' AND $lvlstring"

  2. #2
    I'm New! vpsville is on a distinguished road vpsville's Avatar
    Join Date
    May 22, 2008
    Posts
    16
    Rep Power
    5
    Feedback Score
    0

    Default Re: need quick php help

    I think we'd have to know a lot more about the program to help.

  3. #3
    Permanently Banned West will become famous soon enoughWest will become famous soon enough
    Join Date
    November 4, 2006
    Posts
    264
    Rep Power
    0
    Feedback Score
    0

    Default Re: need quick php help

    I concur to the smallest bit with vps. We would need to know more about the functionality of the script. Although I would simply put a check somewhere to see if their credits are more than 9999 give them level 4, but only if they are a supporter.

  4. #4
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: need quick php help

    bikerboys I think you need to better explain what it is you are trying to do as your explanation makes no sense compared to your code.

    If I am right you basicly have a level system, people use money to gain another level, however if the user is not a supporter (as defined by status) then they can not go past level 3 is this correct?

    Also just to be fussy you can simplify your query string like this

    PHP Code:
    $sSQL "SELECT count(*) FROM users u, stats s,$tab[pimp] WHERE u.username = s.user AND $tab[pimp].code=u.code AND $tab[pimp].networth>'$pmpz[1]' AND s.round='$round' AND $lvlstring"
    but that query doesn't look right at all to me looks very bloated, might be better with joins?
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. A really quick rant..
    By The Webmaster in forum Forum Lounge
    Replies: 7
    Last Post: Mar 25th, 2008, 5:28 am
  2. Need a quick converision EPS to ?
    By Big Dan in forum Graphics & Multimedia
    Replies: 2
    Last Post: Mar 19th, 2008, 2:55 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads