|
|
 |
FN-FORUM: PHP/MySQL Question...
date posted 7th February 2008 21:02
Evening all...
Can someone point me in the right direction for this...
I'm trying to get several fields out of a database record, the fields are as
follow:
NewsDate
NewsHeadline
NewsText
NewsFile
The only field that is coming out at the moment is the first field which is
NewsID.
The code is below.....
TIA
Darren
$rows_per_page = 4;
$db = 'NBPA';
$sql = "SELECT * FROM News";
$result = mysql_query($sql);
$total_records = mysql_num_rows($result);
$pages = ceil($total_records / $rows_per_page);
mysql_free_result($result);
if (!isset($screen))
$screen = 0;
$start = $screen * $rows_per_page;
$sql = "SELECT * FROM News ORDER BY NewsDate ";
$sql .= "LIMIT $start, $rows_per_page";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
for ($i = 0; $i < $rows; $i++)
{
$description = mysql_result($result, $i, 0);
echo "\$description = $description\n";
}
|
 |
|