Jump to content

deleting and table join


Go to solution Solved by Barand,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.