PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
How to do this: If user is male than male icon front of username and if user is female than female icon
mysql table "users" row "gender" Male=1 & Female=2
So if they are a male AND a female display the male icon? If they are not a male AND a female then display the female icon?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
riiel wrote:if they are a male then display the female icon, If they are female then display the female icon.
That's not what your IF statement says.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
As tasairis said, this is very basic PHP. Are you interested in learning PHP or do you just want us to solve this one problem?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
// this says, IF gender is 1 AND gender is 2 then echo $icon1
// gender will never be equal to 1 AND 2 at the same time will it?
if ($users->getCurGender == 1 && $users->getCurGender == 2)
echo $icon1;
// this says, IF the above condition is not true then echo $icon2
// the above condition will never be true will it?
else
echo $icon2;
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.