【发布时间】:2016-06-24 10:06:22
【问题描述】:
我目前正在尝试编写一段代码,我想在我的页面中显示数据库的 2 个单元格,但前提是 person_id 正确。
我以前使用过占位符,但似乎无法在 OOP 中找到这样做的方法?
$connect = new MySQL('localhost','username','password');
$connect->Database('dbname');
$posts = $connect->Fetch('group_table WHERE person_id = :user');
$posts->execute[('user' => $_SESSION['id'])];
if ($posts && mysql_num_rows($posts) > 0) {
echo "Here is some post data:<BR>";
while ($record = mysql_fetch_array($posts)) {
?>
<div class="row">
<div class="col-lg-6 white">
<?php echo $record['groupname'];?>
<?php echo $record['group_omschrijving'];?>
</div>
</div>
【问题讨论】: