07-18-2009, 04:58 PM
|
#6 (permalink)
|
|
The Addict
Join Date: May 2009
Posts: 287
Thanks: 5
|
Well, this would be easier.
PHP Code:
$query = "SELECT id, title, content FROM push_content WHERE type = 0 ORDER by date DESC LIMIT 1"; $data = Array("title", "content"); $n = 0;
if ($result = $mysqli->query($query)) {
/* fetch associative array */ while ($obj = $result->fetch_object()) { $data['title'][$n] = $obj->title; $data['content'][$n] = $obj->content; $n++; } }
As for the option to display content I would store that into the DB and then only query for the ones that are allowed for the situation.
|
|
|
|