xx_princess_xx Posted May 12, 2009 Share Posted May 12, 2009 i am trying to display the image which i have stored as an URL in the database... the table displays all information except for the photo, $result = mysql_query("SELECT * FROM properties"); echo "<table border='1' padding='1'> <tr> <th>Property ID</th> <th>Type</th> <th>Price</th> <th>Address</th> <th>Post Code</th> <th>Photo</th> <th>Available</th> <th>Agent ID</th> </tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['pid'] . "</td>"; echo "<td>" . $row['type'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['post_code'] . "</td>"; echo "<td>" . $row['<img src=photo'] ."</td>"; //here is the part i am stuck with///////// echo "<td>" . $row['isavailable'] . "</td>"; echo "<td>" . $row['agent_id'] . "</td>"; echo "</tr>"; } echo "</table>";mysql_close($con); ?> Link to comment https://forums.phpfreaks.com/topic/157857-solved-display-image-from-mysql-database-using-php/ Share on other sites More sharing options...
Ken2k7 Posted May 12, 2009 Share Posted May 12, 2009 $result = mysql_query("SELECT * FROM properties"); echo "<table border='1' padding='1'> <tr> <th>Property ID</th> <th>Type</th> <th>Price</th> <th>Address</th> <th>Post Code</th> <th>Photo</th> <th>Available</th> <th>Agent ID</th> </tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['pid'] . "</td>"; echo "<td>" . $row['type'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['post_code'] . "</td>"; echo "<td><img src='" . $row['photo'] ."' /></td>"; //here is the part i am stuck with///////// echo "<td>" . $row['isavailable'] . "</td>"; echo "<td>" . $row['agent_id'] . "</td>"; echo "</tr>"; } echo "</table>";mysql_close($con); ?> Link to comment https://forums.phpfreaks.com/topic/157857-solved-display-image-from-mysql-database-using-php/#findComment-832624 Share on other sites More sharing options...
xx_princess_xx Posted May 12, 2009 Author Share Posted May 12, 2009 thanks it works Link to comment https://forums.phpfreaks.com/topic/157857-solved-display-image-from-mysql-database-using-php/#findComment-832646 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.