所以我的查询说有 1 条消息,但它没有出现在表中
查询
<?php
//Unread
$req1 = $db->query('
SELECT
m1.id,
m1.title,
m1.timestamp,
m1.user1,
m1.user2,
m2.id as reps,
blog_users.username
FROM
pm as m1,
pm as m2,
blog_users
WHERE
((m1.user1="'.$session->username.'" and m1.user1read="no" and blog_users.username=m1.user2)
OR
(m1.user2="'.$session->username.'" and m1.user2read="no" and blog_users.username=m1.user1)) and m1.id2="1" and m2.id=m1.id
group by
m1.id
order by
m1.id desc');
$req1->execute();
$req1c = $req1->fetchAll();
$result = $req1->rowCount();
print_r($req1->errorInfo());
?>
错误信息的结果
Array ( [0] => 00000 [1] => [2] => )
过帐表
<?php
//We display the list of unread messages
while($dn1 = $req1->fetch())
{
?>
<tr>
<td class="left"><a href="read_pm.php?id=<?php echo $dn1['id']; ?>"><?php echo htmlentities($dn1['title'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo $dn1['reps']-1; ?></td>
<td><a href="profile.php?id=<?php echo $dn1['userid']; ?>"><?php echo htmlentities($dn1['username'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo date('Y/m/d H:i:s' ,$dn1['timestamp']); ?></td>
</tr>
<?php
}
?>
它应该显示 1 条消息,但没有显示。也很奇怪,它没有显示,因为 mysql 中有结果。