Jump to content

deleting and table join


dmcglone

Recommended Posts

I am having a really hard time understanding how to delete when using a table join. I've looked up examples on here and on the web and I've tried to adopt them to what I need and I'm not having any luck.

I have a table named properties and a table named additional_info, and all I am trying to do is delete the corresponding information in the additional_info table that goes to the MLS_id it is joined with in the properties table.

Here's some code I have been playing with

 

$MLS_id = $_GET['MLS_id'];
    $this->query = ("DELETE properties, additional_info
    FROM properties
    LEFT JOIN properties.MLS_id ON additional_info.info_id = properties.MLS_id
    WHERE additional_info.info_id = $MLS_id");

 

Where am I going wrong?

 

Thanks,

David M.

Link to comment
https://forums.phpfreaks.com/topic/277391-deleting-and-table-join/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.