Jump to content

[SOLVED] function/mysqli help


darkfreaks

Recommended Posts

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

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.