我读了一篇文章,我对我的sql数据库的评论,有两条单独问询,作为一篇文章和评论。
$result = mysql_query("SELECT * FROM articles WHERE article_id= $id ");
$row = mysql_fetch_array($result);
$title=$row[ title ];
........
目 录
$result = mysql_query("SELECT * FROM comments WHERE article_id= $id ");
while($row = mysql_fetch_array($result)) {
$comment_title=$row[ title ];
.........
}
Is the best way to read this set of data from database? OR Is it possible to catch the data through one query or one transaction?
<>光> 我的问题是,第一个问题只是一行,而第二点需要处理(和在html上显示)若干意见。