Displaying images using db

Status
Not open for further replies.

Benden

maging ang maganda mamatay
Jun 4, 2010
2,281
1,480
Hey, how do i display a image on a webpage if its getting the link from a db?
my code is
PHP:
echo "<br><center>$info[Title]</center> $info[Pic] $info[Desc]</table><hr>";
also i cant talk in the shoutbox
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
Something like this?

PHP:
<?php
$imgQ = mysql_query( "SELECT * FROM table WHERE `column` = 'value'" );
if( mysql_num_rows( $imgQ ) == 0 )
{
	echo "0 rows were returned!";
}
else
{
	$imgA = mysql_fetch_array( $imgQ );
	echo "<br><center>" . $imgA["title"] . "</center> " . $imgA["pic"] . " " . $imgA["desc"] . "</table><hr>";  
}
?>

Change the necessary values in $imgQ though.
 
Status
Not open for further replies.

Users who are viewing this thread

Top