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!

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

am I using this for loop correctly
Dear buddies!

Right now I am generating a report with some details for all the dealers.

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

undefined offset help
Hi All,

I kept getting undefined offset PHP notice for a simple for loop. For eg
$va = arr

Refining of search Criteria
Dear Friends

I need a help, I have a search page which of cars related, which has different s

SWF image using php?
Hello once again.

My latest en devour requires me to produce an image of a static .swf that i

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or b

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

Find occurences of unicode characters in string
I need to prohibit filenames with everything but English characters and numbers but regexp and strin

How to generate a random array of integers subject to a certain constraint
I am writing a program that asks the user to enter an integer N and then generates a random array of

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