Getting single value from a single row with Mysql/PHP

前端 未结 1 2018
甜味超标
甜味超标 2021-01-27 07:26

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          


        
相关标签:
1条回答
  • 2021-01-27 08:20

    Yes, mysql_result will do this.

    $result = mysql_result(mysql_query('SELECT FOUND_ROWS()', $db), 0);
    
    0 讨论(0)
提交回复
热议问题