使用Mysql/PHP从单行获取单个值 [英] Getting single value from a single row with Mysql/PHP
本文介绍了使用Mysql/PHP从单行获取单个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通常,我只需要从MySQL那里获得一个我知道存在的值.我使用以下构造:
Often I just need to get a single value from MySQL that I know exists there. I use the following construct:
$result = end(mysql_fetch_array(mysql_query('SELECT FOUND_ROWS()', $db)));
PHP中是否有适当的单个函数可以做到这一点?
Is there a proper single function in PHP that would do this?
推荐答案
是的, 查看全文