Dear all brothers and sisters, I had a folder which stored the pictures. Now I want to display them on the screen with PHP code by SQL For example SELECT product_name, product_price, product_image from product; How can I display product_image filed Help me ???? Thks very much Sam
What does the product_image field contain? How are the images stored in the folder (by product name)?
It does not work. Here is my code $result = mysql_query("SELECT * FROM product");// and (channel=($age)"); echo "<table border='1'> <tr> <th>Nhãn hà ng</th> <th>Sản phẩm</th> <th>Khuyến mãi</th> <th>Ghi chú</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['brand_name'] . "</td>"; echo "<td>" . $row['product_name'] . "</td>"; echo "<td>" . <img src=$row['product_image'] />. "</td>";//<img src=$row[2] /> echo "<td>" . $row['ghichu'] . "</td>"; echo "</tr>"; } echo
Try this while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['brand_name'] . "</td>"; echo "<td>" . $row['product_name'] . "</td>"; echo "<td><img src='".$row['product_image']."' /></td>"; echo "<td>" . $row['ghichu'] . "</td>"; echo "</tr>"; }
whats the output of product_image? TE=lenhhoxung;13235856]It does not work. Here is my code $result = mysql_query("SELECT * FROM product");// and (channel=($age)"); echo "<table border='1'> <tr> <th>Nhãn hà ng</th> <th>Sản phẩm</th> <th>Khuyến mãi</th> <th>Ghi chú</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['brand_name'] . "</td>"; echo "<td>" . $row['product_name'] . "</td>"; echo "<td>" . <img src=$row['product_image'] />. "</td>";//<img src=$row[2] /> echo "<td>" . $row['ghichu'] . "</td>"; echo "</tr>"; } echo[/QUOTE]
next time you should ( when you ask for help ) post the full code of the page to pastie.org and we can help you faster by just editing it from there. I know I had nothing to do with this process because I just found the thread however, when I say 'we' I mean 'other programmers'.