如何使用 MySQLi 只获取一个 INDEXED 行?我目前正在这样做:
How can I only fetch one INDEXED row with MySQLi? I'm currently doing this:
$row = $result->fetch(MYSQLI_ASSOC);
$row = $row[0];
还有别的方法吗?
我知道 mysqli_fetch_row 但它不返回关联数组.
I'm aware of mysqli_fetch_row but it doesn't return an associative array.
使用 $row = $result->fetch_assoc(); - 与 fetch_row() 相同code> 但返回一个关联数组.
Use $row = $result->fetch_assoc(); - it's the same as fetch_row() but returns an associative array.
这篇关于仅使用 MySQLi 获取一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
mysql 中的 store_result() 和 get_result() 返回 falsestore_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
调用未定义的函数 mysqli_result::num_rows()Call to undefined function mysqli_result::num_rows()(调用未定义的函数 mysqli_result::num_rows())
PHP 准备好的语句问题PHP Prepared Statement Problems(PHP 准备好的语句问题)
mysqli_fetch_array 只返回一个结果mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一个结果)
PHP MySQLi 多次插入PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
如何确保 MySQL 中的值在 PHP 中保持其类型?How do I make sure that values from MySQL keep their type in PHP?(如何确保 MySQL 中的值在 PHP 中保持其类型?)