mysql_connect("localhost","username","password");
mysql_select_db("dbname");
$sql = "SELECT * FROM nuke_stories ORDER BY pn_sid DESC LIMIT 3";
$result = mysql_query($sql);
While ($row = mysql_fetch_array($result)) {
$title = $row['pn_title'];
$body = $row['pn_hometext'];
$posted_by = $row['pn_informant'];
$news = '<b>' .$title. '</b><br>
Posted By: ' .$posted_by. '<br>
' .$body. '<br><br>';
}
mysql_close();
This is part of a script that I am writing which extracts the 3 most recent news stories from my PostNuke database.
Now, I want to be able to call the final result (all three news stories) as one single variable. Any ideas on how to do this?
I am really stuck here... I don't know what to do next.