Jump to content

Best way to display pulled SQL Data!?


stublackett

Recommended Posts

Hi,

 

I've got data pulled from a database, This data is for a news item

 

But my major problem is how do I present this data neatly in HTML ?

 

The code is as follows

<?php 
$result = mysql_query("SELECT * FROM $db_table1");
while($myrow = mysql_fetch_assoc($result))
              
        {//begin of loop
$title = $myrow['title'];
$description = $myrow['description'];

        //now print the results:          
echo "<h2>$title</h2>";
echo "<p>$description</p>";

// Now print the options to (Read,Edit & Delete the news)
echo "Modifying Options...<br>";		   
echo "<a href=\"edit_news.php?newsid=$myrow[id]\">Edit </a>";
echo "|| <a href=\"delete_news.php?newsid=$myrow[id]\">Delete </a><br><br>";
}//End While loop
         						
?>

 

The $description field seems to go right across the screen, How do I format that so it goes piece by piece?

 

Any help appreciated

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/110918-best-way-to-display-pulled-sql-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.