Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

PHP: What is wrong with my if statement?

What is wrong with my syntax?
if (mysql_num_rows($user) == 1) && if ( md5($us_pass) == $pass ) {
  //  stuff to do
}
0
rae_rae
Asked:
rae_rae
1 Solution
 
b0lsc0ttCommented:
rae_rae,

Try this:

if ((mysql_num_rows($user) == 1) && ( md5($us_pass) == $pass )) {
  //  stuff to do
}

The complete block should be in parenthesis and you do not need the if statement in the second portion.

b0lsc0tt
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now