Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

please help am getting this error "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\wamp\www\SDPMDashboard\login\home.php on line 7"

OpenStudy (anonymous):

The php code is below <?php include_once('db.php'); // Grab User submitted information $SDPM_Name=$_POST["SDPM_Name"]; $Password=$_POST["Password"]; $result=mysql_query("SELECT SDPM_Name,Password FROM sdpmnamesnew WHERE SDPM_Name='$SDPM_Name' AND Password='$Password'"); $row=mysql_fetch_array($result); if($row["SDPM_Name"]==$SDPM_Name && $row["Password"]==$Password) { include"login2.php"; } else { echo"Sorry, your credentials are not valid, Please try again."; } ?>

OpenStudy (rbx):

Have you tried printing value of $result? Also try this after executing query ```php if(!$result) die (mysql_error()); ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!