What I am trying to do is to add data for a product into a database with MySQL 5.1 and PHP 5.2.12.
I have a table for general fields: name, description, price, number of times purchased, and also I have a table for the images that are associated with that product.
The goal is to have the same id for every image that corresponds to its product. For example, if I add the product to the main table, and its ID gets set to 128, then I want all of its pictures in the picture table to have the id 128.
How do I do this?
You want to use mysql_insert_id(); to get back the autonumbered ID of what you just inserted. You'll then want to use that ID in a link table that links pictures to products.