所以,我有这两行 PHP。
$total_row_count = mysql_fetch_assoc(mysql_query(sprintf('SELECT COUNT(*) as count FROM %s',$table_name),$db));
$total_row_count = $total_row_count['count'];`
有没有办法改变 $total_row_count 的第一个声明,所以第二行不是必需的?
有这种效果的东西(我知道这不是功能代码)。
$total_row_count = mysql_fetch_assoc(mysql_query(sprintf('SELECT COUNT(*) as count FROM %s',$table_name),$db))['count'];
非常感谢!