07-18-2009, 02:50 PM
|
#5 (permalink)
|
|
The Contributor
Join Date: Jul 2009
Posts: 80
Thanks: 13
|
Quote:
Originally Posted by xenon
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.
|
Thanks xexon,
I want to be able to call each title like
$title1 = "this is title 1";
$title2 = "this is title2";
$title3 = "this is title3";
etc...
As I want to allow the template designer to choose how many stories to show on the front page in there design.
I also want to show the content this way.
I then want to come up with a way to have global plugins that will allow the users to choose if they want to show the posters name, date published etc...
I hope that helps.
Thanks
|
|
|
|