louisesanders Posted March 24, 2008 Share Posted March 24, 2008 I am currently trying to learn PHP – I have a whole lot of static websites which really need to upgrade to dynamic sites. The websites are basically business directories where someone clicks on a particular category and I list a whole lot of businesses each with their logo and then one/ two lines of descriptive text with a “More Info” link that links to their page with full details and a small image gallery. I have found scripts on the web for opinion polls, calendars, guestbooks, forums etc etc but nothing for what im looking for…unless I just don’t know what it is called. All I want is to pull the name, logo and small box of descriptive text for each business from a MySql database and then format that data in rows (nicely and neatly) one after each other (similar to these websites: and http://www.sa-hotels-online.com/special-offers.php and http://www.sakidsonthego.com/activity_list.php?activitytypeno=6&subcategoryno=181 ) And then once someone clicks on the “more info” link it again draws info from the database and structures the data in a really clean and structured way ie. (http://www.sa-hotels-online.com/kwa-maritane-lodge/index.php ) I guess the common theme is just formatting everything attractively. Does anyone know of any websites that have tutorials on this type of thing? Or any sample scripts? Thank-you for reading this whole thing! Any advice or direction would be MUCH appreciated!! Link to comment https://forums.phpfreaks.com/topic/97576-tutorials-on-formatting-data/ Share on other sites More sharing options...
ryeman98 Posted March 24, 2008 Share Posted March 24, 2008 Can't help with all of it but assume that you name your variables the same as me. <?php $query = mysql_query("SELECT * FROM `table_name` WHERE column = something"); echo "<table width='100%' border='0'>"; while ($row = mysql_fetch_array($query)) { echo "<tr>"; echo "<td><img src='". $row['image'] ."' alt="" /></td>"; echo "<td><b>". $row['name'] ."</b><br />". $row['description'] ."<br /><br /><a href='page.php'>More Info.</a></td>"; echo "</tr>"; } // End while ?> Link to comment https://forums.phpfreaks.com/topic/97576-tutorials-on-formatting-data/#findComment-499254 Share on other sites More sharing options...
louisesanders Posted March 24, 2008 Author Share Posted March 24, 2008 Thank-you so much for your response, will definitely try this out!! Much appreciated! Rgds Louise Link to comment https://forums.phpfreaks.com/topic/97576-tutorials-on-formatting-data/#findComment-499507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.