Using CSS to format MySQL query


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

If i want to have a news page on my site, which displays all records of a table in descending order by date I am using the below code. I can display it all in a big table but this is a bit boring. Can I use CSS to present these records and still have them repeat like when using a table? Or is it best to just use plain old tables?? How would I add the divs to the below statement? Thanks!

Did you know?Explore Trending and Topic pages for more stories like this.
Here is my code...

<?

include'E:domainssdomain.comuserprivatemysql_connect.php';

mysql_select_db("pix", $con);

$result = mysql_query("SELECT * FROM news_article ORDER BY date DESC");



while($row = mysql_fetch_array($result))
{

echo $row['title'] ;
echo $row['date'] ;
echo $row['content'] ;
echo $row['image_url'] ;
}


mysql_close($con);
?>
No comments posted yet

Your Answer:

Login to answer
334 Like 44 Dislike
Previous forums Next forums
Other forums

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

Help If user voted, block them
On my Prayer request site, i let users Click a button to Pray for somone that has posted a pray, i g

PHP login form help (Done Most of It)
Hi i am having a problem, when i try logging in it is always saying "Invalid Login" im not

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

How to add functionality to a simple php calender?
Hello everyone,

I have just finished creating a simple php calander. Can someone point

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash