07-17-2009, 05:15 PM
|
#4 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
If you go object oriented style, keep it that way:
PHP Code:
$query = "SELECT id, title, content FROM push_content WHERE type = 0 ORDER by date DESC LIMIT 1";
if ($result = $mysqli->query($query)) {
/* fetch associative array */ while ($obj = $result->fetch_object()) { printf ("%s (%s)\n", $obj->title, $obj->content); echo"<br/>"; } }
What exactly are you trying to do, though? You may want to give some examples, as well, so we can figure out how to help you. I, for one, did not understand how using an object instead of an array help you.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|