Php 如何编写mysqli_结果
如何在最后一行设置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
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]);
}