View Single Post
  #22  
Old 08-20-2013, 10:50 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,580
IntoRain is on a distinguished road
Default

Hall Of Famer means the function you made, the whole code from the file

Btw you have the if still liek this?

if($gender = 'f')

It should be if($gender == 'f')

= means you are giving the variable a value. == means you are comparing it (it's a function that says if it is false or true)

Btw if you already have the switch-case you can take the if off. Like

PHP Code:
switch(...)
{

  case 
'f':
     
//it's female
     
break;
  case 
'm':
    
// it's male
     
break;
  default:
   
//error
     
break;

Also if the function receives an adopt, to get the gender of it you don't need to use select, you even use $adopt->gender on the switch. That is confusing me a lot xD To verify if the owner of the item and the owner of the adopt are the same you can use an if($adopt->owner == $item->owner), right?

Last edited by IntoRain; 08-20-2013 at 11:41 PM.
Reply With Quote