help

Discussion in 'PHP' started by Seiya, Jan 23, 2006.

  1. #1
    Hey guys, i got this piece of code and it wont work for some reason, Any advice? Its the first time i try using ||

    
    lets say $cash3 = name
    and $momid = name
    if ($cash0==$momid || $cash1==$momid || $cash2==$momid || 
    $cash3==$momid || $cash4==$momid){
    
    // never evaluates as true
    
    PHP:

     
    Seiya, Jan 23, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Then $cash3 is not the same as $momid.
     
    digitalpoint, Jan 23, 2006 IP
  3. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The thing is it is, if i just echo cash$3 and $ mom ill get the same answers... :/

    --

    nevermind i did some more testing, only $cash0 seems to be defined... sorry ill check that out then
     
    Seiya, Jan 23, 2006 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Maybe there is a hidden character in them or something. Try doing this before the logic to see if the logic evaluates as true then:
    $cash3 = $momid;
    PHP:
     
    digitalpoint, Jan 23, 2006 IP
  5. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the help Shawn,

    I rewrote the MYSQL query that had the cash values, the problem was there. Its working now after i dumped every entry into an array :)
     
    Seiya, Jan 23, 2006 IP