Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How i can add link to image in mySql

New Here ,
Jan 21, 2011 Jan 21, 2011

im trying

add link to image in mysql fiels?

I do not want use blob

TOPICS
Server side applications
4.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jan 21, 2011 Jan 21, 2011

Almost impossible to tell what the problem is from a screenshot but it has something to do with a bad filename path. Make sure that the string you specify is complete and accurate. Also make sure that the images is actually uploaded to the right place.

Translate
Guest
Jan 21, 2011 Jan 21, 2011

You store the filename in the database as a varchar[] of whatever size you need. Then reference it like this:

<img src="<?php echo $row_Recordset1['filename']; ?>" />

or
<img src="/image_directory/<?php echo $row_Recordset1['filename']; ?>" />
if you want to include the file path.
Does this help at all?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2011 Jan 21, 2011

i change image director

and image name, but did not work,

i se outline but not image?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 21, 2011 Jan 21, 2011

You will have to post a link to your live page. There are too many possibilities to do more than guess.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2011 Jan 21, 2011

i get this resalts

2.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 21, 2011 Jan 21, 2011

A screenshot of page is not a link to the page as requested. Link won't matter anyway since we can't see your file structure. View the source of the problem page and assure that the correct img path is referenced in the img src code. The outline w/ an X indicates that the img path is not the same as your file structure on your host.

sidenote: SQL injection attacks by example is a valuable resource. Nice to see someone has it bookmarked

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2011 Jan 21, 2011

here is mysql

3.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2011 Jan 21, 2011
LATEST

thank you i solved problem

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 21, 2011 Jan 21, 2011

Almost impossible to tell what the problem is from a screenshot but it has something to do with a bad filename path. Make sure that the string you specify is complete and accurate. Also make sure that the images is actually uploaded to the right place.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2011 Jan 21, 2011

ok, here is my code

  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row_Recordset1['id']; ?></td>
      <td><?php echo $row_Recordset1['ime']; ?></td>
      <td><?php echo $row_Recordset1['prezime']; ?></td>
      <td><?php echo $row_Recordset1['Form']; ?></td>
      <td><?php echo $row_Recordset1['Sun']; ?></td>
      <td><?php echo $row_Recordset1['Wather']; ?></td>
      <td><?php echo $row_Recordset1['Size']; ?></td>
      <td><?php echo $row_Recordset1['Zone']; ?></td>
     <td><img src="/plants/<?php echo $row_Recordset1['Picture']; ?>" /><td>


      <td><?php echo $row_Recordset1['Picture2']; ?></td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 21, 2011 Jan 21, 2011

Additionally, to add a link to the image, per your original request.

<a href="page.html"><img src="<?php echo recordset['filename']; ?>" alt="<?php echo recordset['filename']; ?>" /></a>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines