![]() |
| ||
| My sql image links in table How can i Load images in to each cell of a table based on its product id? The picture url is stored in field: Product_picurl SELECT `Product_id`,`Product_Name` , `Product_picurl` I have looked around for a photogallery script but cant find one!! Thanks in advance |
| ||
| Re: My sql image links in table 1. execute your sql statement 2. use mysql_fetch_array to capture the data into an array (eg. $row=mysql_fetch_array($sql_result);) 3. Cycle through the array to output the image urls to the page with some sort of loop (foreach, for, while, whatever fits your script/writing style) that's the theory behind it. here's a little sample (very quick and messy mind you, but will help you get the idea): //create sql that gets all the pictures into a table, in order. to get them in some sort of order, try using the ORDER BY clause in your sql, such as in: $sql="SELECT * FROM prod_listing where Product_id ='$ID' ORDER BY some_field_here ASC;";there are multitudes of other approaches you could use to improve this, but maybe this will give you a start. |
| All times are GMT -4. The time now is 11:11 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC