Skip to main content
Participating Frequently
July 17, 2013
Answered

Image from a URL database record

Hi

I am building an online catalog usual stuff product name, link, price, image etc

the product link and image are on another server url's are datatbade cells

no problem with the product link using <td><p><a href="<?php echo $row_Recordset1['productUrl']; ?>" target="_new"> click for more</a></p></td>

But I am having problem with the image have tried

<td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>

   <?php echo $row_Recordset1['description']; ?></td>

but just get an image placeholder box even when uploaded to server and previewed in browser

the whole details are

<table border="1">

  <tr>

    <td>name</td>

    <td>productUrl</td>

    <td>imageUrl</td>

    <td>description</td>

  </tr>

  <?php do { ?>

    <tr>

      <td><?php echo $row_Recordset1['name']; ?></td>

     

      <td><p><a href="<?php echo $row_Recordset1['productUrl']; ?>" target="_new"> click for more</a></p></td>

     

     

      <td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>

   <?php echo $row_Recordset1['description']; ?></td>

    </tr>

    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

</table>

Thank you

This topic is closed to new replies. Start a new post to keep the conversation going.
matthew stuartCorrect answer
Inspiring
July 17, 2013

You have a href in your image src... I've never seen that before, so I wouldn't know if it's correct syntax.

Change:

<td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>

to:

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

and if you want the image to be clickable:

<td><a href="url-here" border="0"><img src="<?php echo $row_Recordset1['imageUrl']; ?>" ></a></td>


2 replies

matthew stuartCorrect answer
Inspiring
July 17, 2013

You have a href in your image src... I've never seen that before, so I wouldn't know if it's correct syntax.

Change:

<td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>

to:

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

and if you want the image to be clickable:

<td><a href="url-here" border="0"><img src="<?php echo $row_Recordset1['imageUrl']; ?>" ></a></td>


Translate
Participating Frequently
July 18, 2013

many thanks for taking the time to reply works fine

Translate