bind_result到一个数组PHP的mysqli prepared声明 [英] bind_result into an array PHP mysqli prepared statement
本文介绍了bind_result到一个数组PHP的mysqli prepared声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
想知道我怎么能一个PHP prepared语句的结果绑定到一个数组,然后我怎么能去调用它们。例如,这个查询
wondering how i could bind the results of a PHP prepared statement into an array and then how i could go about calling them. for example this query
$q = $DBH->prepare("SELECT * FROM users WHERE username = ?");
$q->bind_param("s", $user);
$q->execute();
和这将返回结果的用户名,电子邮件,和ID。想知道如果我可以把它绑定在一个数组中,然后将其存储在一个变量,所以我可以把它整个页面?
and this would return the results the username, email, and id. wondering if i could bind it in an array, and then store it in a variable so i could call it throughout the page?
推荐答案
具体而言,此处的 http://php.net/manual/en/mysqli-stmt.bind-result.php#92505 - cbrandolino
specifically, here: http://php.net/manual/en/mysqli-stmt.bind-result.php#92505 – cbrandolino
这篇关于bind_result到一个数组PHP的mysqli prepared声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文