Hi, I have in my database the location of some images I want to display, all formatted as: I'm trying to diplay them in a webpage but get the following error: The 'x's display fine, matching the number of row in the database, but the images do not. Here is my code: <?php $query = "SELECT product_Picture from products LIMIT 0, 10"; $result = mysql_query($query) or die(mysql_error()); $x=0; while($row = mysql_fetch_array($result)) { echo 'x';//these work $row[x] = substr($row, 3);//removes the leading .. from the stored URLs echo "<img src='".$row."' /><br />"; } ?> Code (markup): Can anyone help me correct this problem? Your help would be most appreciated! Thanks!
use the following code instead: <?php $query = "SELECT product_Picture from products LIMIT 0, 10"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_object($result)) { $link = substr($row->product_Picture, 3); echo "<img src='". $link ."' /><br />"; } ?> PHP:
Oh man thanks soooo much! Works perfectly. I'm gonna look into the use of the arrow, I was stumped by this problem for ages. Thanks again buddy!