Page 1 of 1

Need help with a php statement...

Posted: Tue Jan 04, 2011 7:28 pm
by Starfight
Hi!

I have a problem with the following statement:

Code: Select all

    $dbres				= mysql_query("SELECT UNIX_TIMESTAMP(`huur`) AS `huur`,huur1,`login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`attlosses`,`attwins`,`deflosses`,`defwins`,`cash`,`type`,`clan`,'maffiamode',`avaurl` FROM `[users]` WHERE `login`='{$_GET['x']}'");
    if($def = mysql_fetch_object($dbres)) {
      if($def->login == $data->login){
	    print "  <tr><td class=\"mainTxt\">You kicked yourself in the nuts... now what?.</td></tr>\n";
      }else if($def->login == $admin1)
        print "  <tr><td class=\"mainTxt\">Do NOT attack an admin!</td></tr>\n";
else if($def->maffiamode == 1)
        print "  <tr><td class=\"mainTxt\">This pirate is currently under Davy Jones' protection!!</td></tr>\n";}
      else {
Even when $def->maffiamode == 1
really is set to 1 in the database
it still doesn't display the message...

The first 2 statements (

Code: Select all

if($def->login == $data->login){
and

Code: Select all

      }else if($def->login == $admin1)
work without a problem

need any further info?

Re: Need help with a php statement...

Posted: Wed Jan 05, 2011 2:51 am
by social_experiment
'maffiamode' is different from all the other values which are `value`. Maybe it's that?