Whats wrong with this SQL query

Hi,

I’m trying to use the following delete query:


DELETE FROM People LEFT JOIN PeopleCon ON People.Pid = PeopleCon.Person_id WHERE People.Pname = Peter Kay','Jake Welsh'

Reason for doing it like this is i want to delete from 2 different tables which can be joined by an ID, table structure is below:

CREATE TABLE IF NOT EXISTS People (
Pid int(11) NOT NULL AUTO_INCREMENT,
Pname varchar(255) NOT NULL,
Pdateadded datetime NOT NULL,
Pdeleted int(1) NOT NULL,
PRIMARY KEY (Pid)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS PeopleCon (
PCid int(5) NOT NULL AUTO_INCREMENT,
Person_id int(5) NOT NULL,
PCHid int(5) NOT NULL,
Pid int(5) NOT NULL,
PCorder int(2) NOT NULL,
PCdateadded datetime NOT NULL,
PCdeleted int(1) NOT NULL,
PRIMARY KEY (PCid)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

Any ideas why it doesn’t work?

Thanks

Thanks!

:cool:

After doing a google search i even tried doing this:


DELETE t1, t2 FROM People AS t1 LEFT JOIN PeopleCon AS t2 ON t1.Pid = t2.Person_id WHERE t1.Pname = 'Peter Kay','Jake Welsh';

But that didn’t work either

WHERE People.Pname IN('Peter Kay', 'Jake Welsh');