MySQL help: inserting data into two tables [closed]

JakAdesseones

New Member
I'm having a bit of trouble understanding this.. Okay, so I have two database tables: the first one is:Listings
listing_id -- primary key
title
bedrooms
bathrooms
sq_ft
description
category
album_id - foreign key
and the second one is:

Albums
album_id -- primary key
I'm trying to write a php query function that allows me to insert the above data into my database. However, I'm not quite sure how to include the album_id so it can auto-increment as the listing is created. --- Album_id simply exists to hold a couple of images for the specific listing. Can anyone please explain how I would go about this with an example or source? I heard somewhere that I could possibly do it with a join, but I'm fairly new to php and mysql and don't know how that would work.
All help is appreciated. Thx. Solved. Thanks guys!
 
Top