I´m using access and php to create a database of products and their respective pictures

since a product may have more than one picture, i had to create to tables.

When execute this:


odbc_exec("INSERT INTO PRODUCTS, PICTURES (PRODUCTS.NAME, PICTURES.FILE) VALUES ('POTATO', POTATO.JPG)");

Can you tell why and how to do this using a single query to the database?

    You only need to update the picture table

    $sql = "INSERT INTO picture (name, file) VALUES ($productcode, $filename)"
    

    hth

      That´s what i want!

      I need to know if accesse support this synthax:

      insert into table1, table2, table3

      I have to use 2 tables because each product may have more that 1 pic.

        AFAIK you cannot update multiple tables. I think joined queries are read only

        If you first query would work you would hav put the product name in one table and the filename in the other but no way of kwnowing that the jpeg was related to the product.

          Write a Reply...