php - Missing argument warnings with function -


i have built function handle part of login system specifically.

this error i'm being shot down by:

warning: missing argument 2 dbclass::logcon(), called in c:\xampp\htdocs\1\login.php on line 105 , defined in c:\xampp\htdocs\1\assets\includes\functions.php on line 10

this code in question

if (isset($_post['submit'])) {      $user     = $_post['user'];     $password = $_post['password'];      //to ensure none of fields blank when submitting form if     if (isset($_post['user']) && isset($_post['password'])) {          $user     = stripslashes($user);         $password = stripslashes($password);          $db1 = new dbclass();         $db1->opendb();         $sql = "select * users username='{$user}' , password='{$password}'";           $result = $db1->logcon($sql);         $row    = mysqli_fetch_array($result); 

and finally, function.

function logcon($user, $password) {      $esc_user     = mysqli_real_escape_string($this->conn, $user);     $esc_password = mysqli_real_escape_string($this->conn, $password);     $sql          = "select * users username  ='{$user}' , password='{$password}";     $result       = mysqli_query($this->conn, $sql);      if ($result) {         $numofrows = mysqli_affected_rows($this->conn);         return $numofrows;     } else         $this->error_msg = "could not connect!";     return false;  } 

as can see, have passed 2 arguments. confusion reins admittedly.

you got:

function logcon($user, $password ) 

but

$result=$db1->logcon($sql); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -