doforumda Posted November 12, 2009 Share Posted November 12, 2009 hi i have a problem in displaying images names and description from mysql db. the problem is i want to display names and description in four columns. how can i do this in following code $db = mysql_connect("localhost"); mysql_select_db("porfolioimages", $db); $images = mysql_query("SELECT * FROM projectimages"); echo "<table width='50%'>"; while($row = mysql_fetch_assoc($images)) { echo " <tr> <td> image<br> title/description </td> </tr> "; } echo "</table>"; Link to comment https://forums.phpfreaks.com/topic/181223-need-help-in-displaying-images/ Share on other sites More sharing options...
darkvengance Posted November 12, 2009 Share Posted November 12, 2009 Well that really all depends on what other fields you have in the projectimages table...but here is an example: $db = mysql_connect("localhost"); mysql_select_db("porfolioimages", $db); $images = mysql_query("SELECT * FROM projectimages"); echo "<table width='50%'>"; while($row = mysql_fetch_assoc($images)) { echo " <tr> <td> ".$row['image']."<br> ".$row['description']." </td> </tr> "; } echo "</table>"; Link to comment https://forums.phpfreaks.com/topic/181223-need-help-in-displaying-images/#findComment-956032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.