Update one table to another

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
s1a9r8a0
Forum Newbie
Posts: 1
Joined: Sun Dec 18, 2011 1:54 pm

Update one table to another

Post by s1a9r8a0 »

Dear All,

I need to update the data's from one table(my_channels) to another table(all_package).

I i used the following code. UPDATE all_packages SET channels = 'my_channels.ch_name' WHERE channels != 'my_channels.ch_name'

0 row(s) affected. ( Query took 0.0004 sec )

Please help....
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: Update one table to another

Post by mikosiko »

Code: Select all

UPDATE all_packages SET channels = 'my_channels.ch_name' WHERE channels != 'my_channels.ch_name'
take the single quotes out of there...

Code: Select all

UPDATE all_packages SET channels = my_channels.ch_name WHERE channels != my_channels.ch_name
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Update one table to another

Post by califdon »

What is it that you are trying to do? That SQL looks to me like it would never work, even after correcting for the quotes. Please explain what you are trying to achieve.
Post Reply