我正在创建一个论坛,我正在尝试从 MySQL 中获取值并将它们放入、 和$f_id
变量$f_name
中。由于某种原因它不起作用:$f_desc
$f_date"
<?php
session_start();
require"db_connect.php";
$sql = "SELECT forum_id, forum_name, forum_desc, forum_date FROM forum_tbl";
if ($query = $db->prepare($sql)){
$query->bind_result($f_id, $f_name, $f_desc, $f_date);
$query->execute();
}else{
echo $db->error;
}
?>
和内容connect.php
:
<?php
$db = new mysql("DOMAIN","USERNAME","PASSWORD") or die ("ERROR");
?>