Jump to content

[SOLVED] Help please!


g3mma111

Recommended Posts

Hi. Im fairly new to PHP and cant work out how to do this code properly:

 


if (mysql_num_rows($result) > 0 ) {

or ('$username' = '$ses_username') 

echo ''

  
}
else {



 

i want to make it so that if there are more than 0 results or the session username = the username then it doesnt say anything.

 

I get the error that there should be no 'or' but im not sure how to do it without the or!?

Link to comment
https://forums.phpfreaks.com/topic/64400-solved-help-please/
Share on other sites

if(mysql_num_rows($result) > 0 or $username == $ses_username) {

 

With OR it will return true only if one or both statements are true. With AND boths statements must be true to return true. Use '==' (identical operators) when comparing, cos with '=' u are assignin values. Also im assuming u have a code like this for the session part:

 

session_start();
$ses_username = $_SESSION['user'];

Link to comment
https://forums.phpfreaks.com/topic/64400-solved-help-please/#findComment-321082
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.