行数未显示

时间:2013-10-05 12:27:15

标签: php mysqli

我不明白这个文件有什么问题。我尝试在网站上显示行数,但似乎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;



        }

?>

有什么想法吗?

由于

0 个答案:

没有答案