inserting values from other table.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
unknown_krasher
Forum Newbie
Posts: 3
Joined: Tue Jul 20, 2010 11:59 pm
Location: Philippines
Contact:

inserting values from other table.

Post by unknown_krasher »

hi guys, i have problem selecting and inserting values from tables in mysql. I have this two tables named facility and activity both have id where i need to get and insert it into my reservation table. how will i do that? please help..
User avatar
bradbury
Forum Commoner
Posts: 40
Joined: Wed Aug 25, 2010 11:21 am
Location: Eugene, OR

Re: inserting values from other table.

Post by bradbury »

I'm not sure that I completely understood your problem are you trying to just copy the data in one database to another? or just certain values? Either way all you have to do is

Code: Select all

"INSERT INTO db_you_want_info_to_be_copied_to
		SELECT *
		FROM db_you_want_to_copy"
Post Reply