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

Export hangs
Hi all, please help

I have a Oracle 10.2.0.3.0 database. When I want to query the dba_segmen

Recognising Revenue daily
Hello.
Has anyone come across daily recognition of deferred income?
We want to implement R

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/

In a nutshe

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

xApp Analytics in BI 7.0
Dear all,

I am trying to implement xApp Analytics in BI 7.0. After I installed the analyt

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

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