Jump to content

need help in displaying images


doforumda

Recommended Posts

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

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>";

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.