Fancy new display

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stijn22
Forum Commoner
Posts: 43
Joined: Sat Aug 13, 2011 10:14 am

Fancy new display

Post by stijn22 »

Hi,

I'm currently making a news section. With this code I have a nice, pretty standard, output:

Code: Select all

<?php
							
							require_once("connect.php"); //Voor de connectie met de database.
							
							$select = "SELECT * FROM nieuws ORDER BY Id DESC";
							$query = mysql_query($select) or die(mysql_error());

							while ($list = mysql_fetch_object($query))
							
							{
    					
    					echo "<b>Datum: </b>$list->datum<br/>";
    					echo "<b>Bericht: </b>$list->bericht<br/>";
    					echo "<b>Auteur: </b>$list->auteur<br/>";
    					echo "<img src=\"images/line-nieuws.jpg\"><br/><br/>";
							}
              ?>
Ok, this is just plain text output, with a line underneath each item. But I saw this site: http://stabyourself.net/ and I think that their news display (with the date and title) looked really good. And I want something similar. Does anyone have a nice link of a tutorial, or can someone explain it here?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Fancy new display

Post by Celauran »

If you don't already have it, I'd recommend getting the Firebug extension. Right-click on any element and choose "Inspect element". Once you see how he's got things laid out, working out the required PHP should be trivial.
Post Reply