Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to bind multiple parameters to mysqli query using -'php,mysqli'


how to bind multiple parameters to mysqli query  using -'php,mysqli'

I have a mysql query, but I can't bind param for it

SELECT users.email,users.handle,userprofile.mobile FROM users,userprofile WHERE
users.email =? OR users.handle =? OR userprofile.mobile=?


I've tried below line

    $query = "SELECT users.email,users.handle,userprofile.mobile FROM users,userprofile WHERE users.email =? OR users.handle =? OR userprofile.mobile=?";
$stmt = $mysqli->prepare($query);
$stmt->bind_param("sss",$email,$username,$mobile);
if ($stmt->execute()) {
if($stmt->num_rows){


   echo '......';
    }
}


but I've received and error :

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string
doesn't match number of bind variables

    

asked Sep 7, 2015 by rajesh
0 votes
3 views



Related Hot Questions



Government Jobs Opening


...