checkmodem12
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by checkmodem12
-
-
thanks that helps a lot. let me try to see how it will look. thanks again.
-
what i'm trying to do is display an item description with corresponding picture. right now i just have this code which displays all the items in "crafts" field. how would i display the picture? would i need to put the pictures in a separate database then call it or some say to just put a link to the picture but i imagine this being difficult if the description loops. please help.
<?
$username="";
$password="";
$database="";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM table WHERE classification='crafts'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$description=mysql_result($result,$i,"description");
$price=mysql_result($result,$i,"price");
$classification=mysql_result($result,$i,"classification");
?>
how to display picture from database
in MySQL Help
Posted
<?
$username="";
$password="";
$database="";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM test_mysql WHERE classification='crafts'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$description=mysql_result($result,$i,"description");
$price=mysql_result($result,$i,"price");
$picture=mysql_result($result,$i,"picture");
$classification=mysql_result($result,$i,"classification");
?>
<table width="100%">
<tr><font face="Arial, Helvetica, sans-serif" size="2">Name:<? echo $id; ?></font></tr>
<tr><font face="Arial, Helvetica, sans-serif" size="2">Description: <? echo $description; ?></font></tr>
<tr><font face="Arial, Helvetica, sans-serif" size="2">Price: <? echo $price; ?></font></tr>
<tr><font face="Arial, Helvetica, sans-serif" size="2">Picture: <a href="<? echo $picture; ?>"><? echo $picture; ?></a></font></tr>
<tr><font face="Arial, Helvetica, sans-serif" size="2">Class: <? echo $classification; ?></font><br><br></tr>
<?
$i++;
}
?>