Jump to content

checkmodem12

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by checkmodem12

  1. this is the code that shows the URL link of the picture that is in my database. is there a way to display so the picture appears and not just the link?




    <?
    $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++;
    }





    ?>
       
  2. 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");
    ?>
×
×
  • 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.