darkfreaks Posted April 2, 2009 Share Posted April 2, 2009 ok so i have a function to check the login i converted into mysqli prepared statement. i need to know how i would change the if statement to compare the results. ??? <?php function check_login(){ $connect=connecto(); // Check matching of username and password. $stmt=$connect -> prepare("SELECT * FROM admin WHERE username=? AND password=?"); $stmt ->bind_param('ss',$username,$md5_password); $stmt ->execute(); $stmt ->close(); $connect ->close(); if(mysql_num_rows($result)!=='0'){ // If match. session_register("username"); // Craete session username. header("location:main.php"); // Re-direct to main.php exit; }else{ // If not match. echo"--- Incorrect Username or Password ---"; }?> } Link to comment https://forums.phpfreaks.com/topic/152307-solved-functionmysqli-help/ Share on other sites More sharing options...
darkfreaks Posted April 2, 2009 Author Share Posted April 2, 2009 also i noticed the password is md5 so it wouldnt be a string or an integer what would i put it as ??? Link to comment https://forums.phpfreaks.com/topic/152307-solved-functionmysqli-help/#findComment-799861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.