我不明白这个文件有什么问题。我尝试在网站上显示行数,但似乎mysqli_num_rows函数不起作用。
<?php
$con4 = mysqli_connect("localhost", "username", "password", "db");
if (mysqli_connect_errno($con4))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sqlquery4 = "SELECT * FROM `users` WHERE oauth_uid = '$uid' AND oauth_provider = '$oauth_provider'";
$query = mysqli_query($con4, $sqlquery4);
$result = mysqli_fetch_array($query);
if( !empty($result) ) { /* user exist */ } else {
if( strlen($shkurtimi) > 0) {
$vlera = $shkurtimi;
} else {
$vlera = $username;
}
$sqlusernameinjejte = "SELECT username, id, verifikuar FROM users WHERE username = '$vlera' AND verifikuar = 'po'";
$queryusernamenjejt = mysqli_query($con4, $sqlusernameinjejte);
$numusernamenjejt = mysqli_num_rows($queryusernamenjejt);
echo "1) number of rows --> " . $numusernamenjejt;
$sqlemailinjejte = "SELECT email, id, verifikuar FROM users WHERE email = '$email' AND verifikuar = 'po'";
$queryemailnjejt = mysqli_query($con4, $sqlemailinjejte);
$numemailnjejt = mysqli_num_rows($queryemailnjejt);
echo "2) number of rows --> " . $numemailnjejt;
}
?>
有什么想法吗?
由于