can someone help me with this pls..

DELETE FROM site_post, site_comments WHERE$id AND site_comments.matchid=$id

needing to delete two rows one from each table.

IIRC, this only works if the column names are the same in both tables.

Another option would be to create a foreign key between the two columns with ON DELETE CASCADE.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.