EDIT: Thanks for your reply, the * is a typo I missed it's not in the actual source. Also for picking up. Everything is working as it should, but here it is: I have a table named filename consisting filename_id (foreign key) image (containing the image.
Jpg) and thumbnail (containing the image. Jpg) the filename_id relates to products filename (index). So the images relates to the products and category selected by the user.
I get all the data with 1 image related (products filename field) echoed but do not get the images related from the filename table. Hope some of this makes some sense. €“ John 10 mins ago Ok so fist you need to get products and categories: SELECT category.Id as category_pk, category_id, products.
* from category, products WHERE products. Id = category. Category_id AND category.
Id =? ; the "?" is the category id youve gotten/sanitized form your request. This gets you all your products for a given category and all the related category info for each product.
Then for your images you are goin to issue have to issue another query since you have multiple images so foreach product you do: SELECT filename. * FROM filename, products WHERE filename. Filename_id = products.
Filename AND filename. Filename_id =? ; This I very DB heavy because your going to query for images for each product... Another way to do it would be to query for all images joined with the products and category and then us some php to get everythoing orgainzed into sructure you can use with your output functions for the html.
That way you only do a single query. Also if its not to late you may want to revise your schema... this is very confusing! I would have done something like the following: category: id (pk auto increment) name (index mul or unique) product: id (pk, auto increment) category_id (fk to category.
Id) name (index multi) description measurements product_image: id (pk, auto increment) product_id (fk to product) image_file (image filename) thumbnail_file (thumbnail filename) your missing the ending quote on your src. You also need to close that image tag... and why do you have a * in the tag? (corrected below): echo ""; Aside form that what is the eaxct problem you are having?
Can you not find the images? Are you getting the wrong names/categories. Etc.? also this is kind of ugly in my opinion... you might want to make use of sprinf here like so: echo sprintf('', $row'filename', $row'name', $row'name' ).
1 Thanks for your reply, the * is a typo I missed it's not in the actual source. Also for picking up. Everything is working as it should, but here it is: I have a table named filename consisting filename_id (foreign key) image (containing the image.
Jpg) and thumbnail (containing the image. Jpg) the filename_id relates to products filename (index). So the images relates to the products and category selected by the user.
I get all the data with 1 image related (products filename field) echoed but do not get the images related from the filename table. Hope some of this makes some sense. – John Dec 5 '09 at 20:54 see my edits above.
– prodigitalson Dec 5 '09 at 21:18 Firstly many thanks for all your help and support it is very much appreciated. I am finding this quiet difficult trying to sort out, I am not so familiar with backend mysql,php programming but I am getting by thanks to your help. OK eddited the top what I’ve done so far: – John Dec 7 '09 at 0:47.
Echo "Measurements: " . Echo "" . Php include ("include/head.
Die('Could not connect: ' .
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.