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

How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul

Agency Business Process
Hi,

I don’t understand the process of the agency business in SAP.

In my

Grids not displaying decimals, and behaving differently on different PCs?
Hello,

I coded a relatively simple MII application that allows data from a form to be add

generating all possible random letters
hi'

how can i randomize the letters a,b,c,d,e all possible ways, and i want to print the res

Expandable Post Code
Hi,

Hope you can help. Which currently I haven't upgraded to connect to a mysql server, so i

Add trigger to UpdatePanel programmatically
Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel whi

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

PEAR in appliactiond development
When I was picking up PHP I went from procedural programming, fairly quickly into OOP, then after wr

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

Strange PHP/mySQL error ... am I just tired?
Code: <?

## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostNam

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