我具備的功能:PHP MySQL的功能顯示在HTML
function get_current_users($current_users)
{
global $db;
$current_users = $db->EscapeString($current_users);
$total_current_users = $db->QueryFetchArray("SELECT COUNT(*) FROM users AS total_current_users");
return $total_current_users['total_current_users'];
}
但我不知道如何輸出結果,我試過下面的選項,但沒有顯示:
`<?$total_current_users?>
<?['$total_current_users']?>
<?=data['$total_current_users']?>`
當我在我的functions.php中使用該語法時,該網站只顯示空白,如果有任何方法來使用函數來格式化上面的示例嗎? – CustomNet
在改變任何東西之前,我們應該看看你的函數正在做什麼,請在你的函數中,在'return'add'var_dump($ total_current_users);'這應該告訴你查詢是否做任何事情。 –