brentnewbury
Programmer
Hi all,
I have a script that is ment to output, all comments relating to a news article, to the browser. The problem is; it only outputs the first record.
I have my database stuff in a class. I don't believe it is that to be causing the problem.
Here is my script:
-----
-----
(NOTE: the [tt]do_output[/tt] function just parses the HTML (which is also retrieved from the database) and then sends it to the browser)
Thank you in advance,
Brent Newbury
I have a script that is ment to output, all comments relating to a news article, to the browser. The problem is; it only outputs the first record.
I have my database stuff in a class. I don't believe it is that to be causing the problem.
Here is my script:
-----
Code:
$comments = $DB_connect->query("SELECT user_id,comments,comments_timestamp FROM comments WHERE news_id='".$news_id."'");
while ( $comment = $DB_connect->fetch_array($comments) ) {
/* put info into readable variables */
$user_id = $comment['user_id'];
$comment = $comment['comments'];
/* get user information, based on user_id */
get_user_info($comment['user_id']);
/* get the website information and settings */
get_site_info("comments");
/*output the comment to the browser */
eval("do_output(\"".get_template("comments",1,1)."\",1);");
}
(NOTE: the [tt]do_output[/tt] function just parses the HTML (which is also retrieved from the database) and then sends it to the browser)
Thank you in advance,
Brent Newbury