news_id , timestamp , login_id , headline,
我想回应除了login_id = 1
之外的所有标题和时间戳。我怎样才能实现这个目标?
我想做点什么
select timestamp, headline, login_id;
echo everything exept login_id = 1;
打印在桌子上?
谢谢你的阅读。答案 0 :(得分:1)
<?php
$query=mysql_query("SELECT timestamp, headline, login_id FROM news WHERE login_id <> 1");
while ($row=mysql_fetch_assoc($query)){
echo $row['timestamp'].' '.$row['headline'].' '.$row['login_id'];
}
?>
答案 1 :(得分:0)
SELECT timestamp, headline, login_id FROM my_table WHERE login_id != 1;
答案 2 :(得分:0)
您将使用的SQL查询是
SELECT timestamp
, headline
, login_id
FROM news
WHERE login_id <> 1
答案 3 :(得分:0)
$reuslt = mysql_query('SELECT timestamp, headline, login_id FROM news WHERE login_id <> 1');
echo '<table>';
while($row = mysql_fetch_assoc($result))
{
echo "<tr><td>".$row['timestamp']."</td><td>".$row['headline']."</td></tr>";
}
echo "</table>";