Problem display image through image path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nma
    New Member
    • Aug 2007
    • 93

    Problem display image through image path

    [PHP]<td width="65" valign="top" width="65" height="44" border="1" vspace="2"><img src="<?php echo $row["imgSelectedPat h"];?>"></td>
    <td width="195" class="eventEnt ryText" ><b><? echo " SHOT : $shotNumber";?> <br /></td>[/PHP]

    Hi
    I want to display jpeg image stored in a databse but have problem the image does not display. only show shotnumber. What is wrong with the first line of code? The code can display list of shots from table but the jpeg does not appear.

    This are fields in my table.
    imgSelectedPath =C:\..\..\..\.. \
    imgSelected Keyframe = C:\..\..\..\..\ keyfrm.jpg
  • jx2
    New Member
    • Feb 2007
    • 228

    #2
    we need to know more about your script
    is that file name(path) you store in mysql?
    or jpegs binary?
    what about you mysll query?

    if you trying to display binary this way it wont work

    regards jx2

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Code:
      C:\..\..\..\..\keyfrm.jpg
      Why you using this way of path? instead you can use the relative path for the image. but are you hosting this images in the table, in binary format or is it just the name on the table?

      Comment

      • pritipshah
        New Member
        • Sep 2007
        • 11

        #4
        Originally posted by nma
        [PHP]<td width="65" valign="top" width="65" height="44" border="1" vspace="2"><img src="<?php echo $row["imgSelectedPat h"];?>"></td>
        <td width="195" class="eventEnt ryText" ><b><? echo " SHOT : $shotNumber";?> <br /></td>[/PHP]

        Hi
        I want to display jpeg image stored in a databse but have problem the image does not display. only show shotnumber. What is wrong with the first line of code? The code can display list of shots from table but the jpeg does not appear.

        This are fields in my table.
        imgSelectedPath =C:\..\..\..\.. \
        imgSelected Keyframe = C:\..\..\..\..\ keyfrm.jpg

        Hi There,

        When you write like these
        [code=php]<img src="<?php echo $row["imgSelectedPat h"];?>">
        it will start Quote frpm "<? and ends to $row[", again starts at "]; at ends to ?>"
        [/code]
        so it will give error so try below insted of this
        [code=PHP ]
        <?php $ImgValue = $row["imgSelectedPat h"]; ?>
        <img src="<?php print $ImgValue; ?>">
        [/code]
        And if possible try to store only Image Name in your database.

        Regards,
        Priti Shah
        Last edited by ak1dnar; Sep 3 '07, 03:40 AM. Reason: Added the CODE Tags

        Comment

        • nma
          New Member
          • Aug 2007
          • 93

          #5
          Originally posted by pritipshah
          Hi There,

          When you write like these
          [code=php]<img src="<?php echo $row["imgSelectedPat h"];?>">
          it will start Quote frpm "<? and ends to $row[", again starts at "]; at ends to ?>"
          [/code]
          so it will give error so try below insted of this
          [code=PHP ]
          <?php $ImgValue = $row["imgSelectedPat h"]; ?>
          <img src="<?php print $ImgValue; ?>">
          [/code]
          And if possible try to store only Image Name in your database.

          Regards,
          Priti Shah

          thanks ...Priti Shah

          Comment

          Working...