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

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

Login script (probably a simple error)
dbConfig.php
Code: <?
// Replace the variable values below
// with your specific dat

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

type check while uploading
Hi Everyone,

How can I check the exact type of a file while uploading on my site?

Here

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

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

QuoteBlah blah

Blah blah

etc
but when i ech

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