Jump to content

Tutorials on formatting data


louisesanders

Recommended Posts

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

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
?>

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.