Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: problem with showing up an image

  1. #1
    nicnicnic is offline Newbie
    Join Date
    Nov 2008
    Posts
    16
    Rep Power
    0

    problem with showing up an image

    hi all im new here and im new to php
    i have a problem with showing the image from my mysql database


    here is my table im working with from my database

    Code:
    CREATE TABLE upload2 (
    id INT NOT NULL AUTO_INCREMENT,
    name VARCHAR(30) NOT NULL,
    type VARCHAR(30) NOT NULL,
    size INT NOT NULL,
    path VARCHAR(60) NOT NULL,
    PRIMARY KEY(id)
    );
    here is the code to show the image

    HTML Code:
    <html>
    <head>
    <title>Download File From MySQL</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    
    Code:

    <?php
    $connection 
    mysql_connect("localhost","root","") or die("impossible de se connecter au serveur mysql.<p>Veuillez réessayer plus tard");
    $res mysql_select_db("upload3") or die("impossible de sélectionner la base de données <b>ecole</b>.<p>Veuillez réessayer plus tard");

    $requeteStr "SELECT path FROM upload2 where id = 4";
    $resultatRequete mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
    $result=mysql_query($requeteStr);


    while (
    $row mysql_fetch_array($result)) 
     {
      
    $path $row['path'];
      echo 
    $path;
    ?>
       <img src="<?$path;?>" border="0">
    <?php        
     
    }
    ?>
    so whats wrong about it ?

    it showing me an icone instead of the image... its

    sad that because i have just one post, i cant show any screenshot of what its look like atm...

    but does anyone has a clue why it shows an icone instead of the image ?
    Last edited by Jaan; 11-16-2008 at 03:50 AM. Reason: Please use code tags when you're posting your codes!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: problem with showing up an image

    moved to the correct forum.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20

    Re: problem with showing up an image

    I am not entirely sure what you mean. Perhaps upload the screen shot to imageshack or photobucket and post the link, but you have to be clever as to how you post the link, since you don't have enough posts to do that either.

    Have you ensured $path is the path to the image, and it does exist?

  5. #4
    nicnicnic is offline Newbie
    Join Date
    Nov 2008
    Posts
    16
    Rep Power
    0
    222

    333

    444

    aaa

    www

    123

    lol

    lmao

    finally 10 tops

    sry to have done 10 posts in a row but i need it to show you the images...

    here how its look atm

    its not the image thats showing up but an icone... why ?

    ImageShack - Hosting :: testja6.jpg

    and yes all the path exists in my c:\lol\ here is there screenshot

    ImageShack - Hosting :: testdc9.jpg

    ImageShack - Hosting :: testqt5.jpg

    any idea why my image aint showing up ?
    Last edited by WingedPanther; 11-14-2008 at 07:30 PM. Reason: That wasn't absolutely necessary. Just give us the site but NOT as a link, as John alluded to.

  6. #5
    mikelbring is offline Programmer
    Join Date
    Jul 2008
    Location
    Nebraska
    Posts
    118
    Rep Power
    0

    Re: problem with showing up an image

    This is a funny mistake. You didn't echo/print the path.

    Code:
    <img src="<?=$path?>" border="0">
    or

    Code:
     <img src="<?echo $path;?>" border="0">
    Realize the Web Web services and design.

  7. #6
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: problem with showing up an image

    Code:
    $requeteStr "SELECT path FROM upload2 where id = 4";
    $resultatRequete mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
    $result=mysql_query($requeteStr); 
    Another thing i wonder about is why you does the query twice as in above?

  8. #7
    mikelbring is offline Programmer
    Join Date
    Jul 2008
    Location
    Nebraska
    Posts
    118
    Rep Power
    0

    Re: problem with showing up an image

    There was a couple things I was going to point out about his MySQL techniques but I figured I'd just help him with this problem and not bug on how he fetches from MySQL.
    Realize the Web Web services and design.

  9. #8
    Join Date
    Sep 2008
    Location
    Australia
    Posts
    4,834
    Blog Entries
    10
    Rep Power
    51

    Re: problem with showing up an image

    Not to sure, but from the posts above should help you. Mainly the echo command LOL!!
    jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
    Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!

  10. #9
    nicnicnic is offline Newbie
    Join Date
    Nov 2008
    Posts
    16
    Rep Power
    0

    Re: problem with showing up an image

    you guys are maybe pro at php but you guys are moron about the life and how you laugh at someone who needed help im sure u guys werent so good at start in php too

    anyway **** off and bye

    and the image doesnt show up even with echo
    i just see the icone again
    you pros...
    so ty for the big help...
    chow lollllllllllllll


    and you can ban me i dont care lollllll

  11. #10
    mikelbring is offline Programmer
    Join Date
    Jul 2008
    Location
    Nebraska
    Posts
    118
    Rep Power
    0

    Re: problem with showing up an image

    Then don't ask for help. You brought it on your self.
    Realize the Web Web services and design.

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 10-24-2011, 06:25 AM
  2. showing current date/time problem !!
    By Paulo_Jorge in forum PHP Development
    Replies: 4
    Last Post: 06-22-2011, 12:42 PM
  3. problem in showing the pages of menu
    By fardamm in forum PHP Development
    Replies: 3
    Last Post: 12-07-2010, 10:05 AM
  4. i have image problem
    By pius4real in forum PHP Development
    Replies: 1
    Last Post: 10-18-2010, 01:05 PM
  5. Problem with PHP. Same value always showing up
    By system32 in forum PHP Development
    Replies: 0
    Last Post: 03-13-2010, 11:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

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