hi all
im trying to pull an array of data from mysql
this is the code im using.
//the sql syntax below pulls the last 7 records from the database
$sql = "SELECT * FROM db_news ORDER BY 'id' DESC LIMIT 7";
$query = mysql_query($sql) or die('MYSQL QUERY ERROR' . mysql_error());
while($row = mysql_fetch_array($query))
{
echo $row['id'];
}
the code above outputs 'id's' 7 to 1 as 7654321
what i want to do is explode the 7654321 into an array so i can call them any where on the page. and not just while the while loop is running,
complicated ?
what im trying to do is grab the latest 7 news reports from mysql and then display them in certain places on a webpage
thanks for reading
DR