tet3828 Posted October 26, 2006 Share Posted October 26, 2006 To the contributers so far... You guys rock, thanks again and again. Quick coding question...I wonderful and helpfull script posted by Orio but Im having trouble getting the image to showI have commented the problem area. The link to my image is in a mySQL table and instead of showing the image its showing the code. What the deal here?<?phpif(!isset($_POST['submit'])){die("<html><body><form action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\"><select name=\"cat\"><option value=\"Holiday\">Holiday</option><option value=\"Animals\">Animals</option></select><input type=\"submit\" name=\"submit\" value=\"Search!\"></form></body></html>");}$qry = "SELECT itemName,itemPrice,itemSmall FROM `products` WHERE itemCat='".$_POST['cat']."'";$result = mysql_query($qry) or die(mysql_error());echo "<table border=\"1\"><tr><td>Name</td><td>Price</td><td>Thumbnail</td></tr>";while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['itemName']."</td>"; echo "<td>".$row['itemPrice']."</td>"; echo "<td><img src=\"".$row['itemSmall']." /></td>"; \\\itemSmall is the location of my thumbnail on the server echo "</tr>";}echo "</table>"; Quote Link to comment Share on other sites More sharing options...
Orio Posted October 26, 2006 Share Posted October 26, 2006 I think that's my error.Change this:echo "<td><img src=\"".$row['itemSmall']." /></td>";Into:echo "<td><img src=\"".$row['itemSmall']."\" /></td>";And you dont really need to open a new thread for every issue, you can reply if you have a problem :)Orio. Quote Link to comment Share on other sites More sharing options...
tet3828 Posted October 26, 2006 Author Share Posted October 26, 2006 WOW thanks that worked like a charm... PHP is a bear. all the "", / , \ ect. how do you know where to put all that garbage.I've got a 700 page php book Novice to Professional but pin pointing that information (if its in there) would have been Impossible. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.