Results 1 to 3 of 3

Thread: [RESOLVED] Regarding pictures with Databases

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2007
    Posts
    45

    Resolved [RESOLVED] Regarding pictures with Databases

    Hi, I have a simple sql table with 2 fields. The first field is a link and in the second field I would like to have a picture (smiley face or a sad face). Should i enter the whole <img src=....... in the sql table or can I do something with my code below so that it automatically makes "1" to a happy face and "2" to a sad.
    If thats possible i would like to know how i can improve my code.

    PHP Code:
    $result mysql_query($query) or die ("Error in query: $query. ".mysql_error());
    if (
    mysql_num_rows($result) > 0) {
     echo 
    "<table cellpadding=0 cellspacing=2 border=1 width=800 bgcolor=green>";
        while(
    $row mysql_fetch_row($result)) {
            echo 
    "<tr>";
            echo 
    "<td>".$row[0]."</td>";
            echo 
    "<td>".$row[1]."</td>";
            echo 
    "</tr>"
    Tell me if I need to be more specified.

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Regarding pictures with Databases

    you should have both the URL and the number designated to the smiley
    My usual boring signature: Something

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2007
    Posts
    45

    Re: Regarding pictures with Databases

    can you please show a code example?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width