stublackett Posted June 19, 2008 Share Posted June 19, 2008 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 More sharing options...
waynew Posted June 19, 2008 Share Posted June 19, 2008 I usally build the html first to get the layout right. Get the html correct. Div tags in the right place etc. Type in some words to see how it will handle content. Use CSS to style etc. Then integrate your php. Link to comment https://forums.phpfreaks.com/topic/110918-best-way-to-display-pulled-sql-data/#findComment-569031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.