Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何编写mysqli_结果_Php_Html_Mysql - Fatal编程技术网

Php 如何编写mysqli_结果

Php 如何编写mysqli_结果,php,html,mysql,Php,Html,Mysql,如何在最后一行设置mysqli_结果 if(isset($_POST['thename']) === true && empty($_POST['thename']) === false) { $getVal = mysqli_real_escape_string($cutConn_db, trim($_POST['thename'])); require '../db/cb_bz.php'; $query = mysql_query(" SEL

如何在最后一行设置mysqli_结果

if(isset($_POST['thename']) === true && empty($_POST['thename']) === false) {
    $getVal = mysqli_real_escape_string($cutConn_db, trim($_POST['thename']));

    require '../db/cb_bz.php';
    $query = mysql_query("
    SELECT 'photos'.'theurl' FROM 'names' WHERE 'names'.'thename'".$getVal."'");
    $resultA = mysqli_query($cutConn_db, $query);
    $rowz = mysqli_fetch_row($resultA);
    $tota_rowz = $rowz[0];

    echo($tota_rowz !== 0) ? mysqli_result($query, 0, 'theurl') : 'Not found.';
}
够了

我想你需要 您可以通过
$rowCount=mysqli\u num\u rows($resultA)进行检查如果收到结果。
而不仅仅是:

while ($row = mysqli_fetch_row($resultA)) {
    printf ("%s \n", $row[0]);
}

为什么要混合使用mysql和mysqli函数?!我知道如何在mysql中实现这一点。但是我在问你使用mysqli时如何写作?一些好的老式RTFM怎么样@deceze谢谢-期待更多。感谢您的输入。
while ($row = mysqli_fetch_row($resultA)) {
    printf ("%s \n", $row[0]);
}