Hello guys, i have implemebted facebook login for my website. However, tring to store the data into my local db seems to be a problem. I'll need a little assistance with the coding.
Thanks in advance.
BELOW IS THE ERROR MESSAGE I GET
Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/xxxx/public_html/3rd_party/fbOAuth/functions.php on line 16
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/xxxx/public_html/3rd_party/fbOAuth/functions.php on line 17 Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/xxxx/public_html/3rd_party/fbOAuth/functions.php on line 20
MY CODE
<?php
//require 'dbconfig.php';
$DBhost = "localhost";
$DBuser = "xxxx";
$DBpass = "xxxx";
$DBname = "xxxx";
$DBcon = new MySQLi($DBhost,$DBuser,$DBpass,$DBname);
if ($DBcon->connect_errno) {
die("ERROR : -> ".$DBcon->connect_error);
}
function checkuser($fbid,$fbfullname,$femail){
LINE 16: $check = mysqli_query("select from Users where Fuid='$fbid'");
LINE 17: $check = mysqli_num_rows($check);
if (empty($check)) { // if new user . Insert a new record
$query = "INSERT INTO Users (Fuid,Ffname,Femail) VALUES ('$fbid','$fbfullname','$femail')";
mysqli_query($query);
} else { // If Returned user . update the user record
$query = "UPDATE Users SET Ffname='$fbfullname', Femail='$femail' where Fbid='$fuid'";
LINE 20: mysqli_query($query);
}
}?>
I'll be grateful for all the help i can get.