Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4034118
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:55:56+00:00 2026-05-20T11:55:56+00:00

i would think that a delete would be pretty simple, I haven’t been able

  • 0

i would think that a delete would be pretty simple, I haven’t been able to figure out why I’m getting these errors and the delete isn’t working. I’ve tried hard coding the id of the record and just running that one line of code. Why would I get these errors, and how would i go about finding how to fix it.

  $this->RentalLineitem->delete(1979);

I’m getting the following errors with the simple delete:

  Warning (512): SQL Error: 1066: Not unique table/alias: 'Inventory' [CORE\cake\libs\model\datasources\dbo_source.php, line 684]

  Query: SELECT `RentalLineitem`.`ri_num`, `RentalLineitem`.`h_num`, `RentalLineitem`.`i_num` FROM `rental_inv` AS `RentalLineitem` LEFT JOIN `rental_in` AS `Rental` ON (`RentalLineitem`.`ri_num` = `Rental`.`ri_num`) LEFT JOIN `hotel` AS `Hotel` ON (`RentalLineitem`.`h_num` = `Hotel`.`h_num`) LEFT JOIN `inv` AS `Inventory` ON (`RentalLineitem`.`i_num` = `Inventory`.`id`) LEFT JOIN `inv` AS `Inventory` ON (`Inventory`.`i_num` = `RentalLineitem`.`id`) WHERE `RentalLineitem`.`id` = 1979 LIMIT 1

  Query: DELETE `RentalLineitem` FROM `rental_inv` AS `RentalLineitem` LEFT JOIN `inv` AS `Inventory` ON (`RentalLineitem`.`i_num` = `Inventory`.`id`) LEFT JOIN `rental_in` AS `Rental` ON (`RentalLineitem`.`ri_num` = `Rental`.`ri_num`) LEFT JOIN `hotel` AS `Hotel` ON (`RentalLineitem`.`h_num` = `Hotel`.`h_num`) LEFT JOIN `inv` AS `Inventory` ON (`RentalLineitem`.`i_num` = `Inventory`.`id`) WHERE `RentalLineitem`.`id` = 1979

I figured it out, as soon as I clicked the post button. Odd that I worked on it for an hour couldn’t figure out what was going on, but I post the question and I imediately realize that I have 2 records in my RentalLineitem model pointing to Inventory. but I don’t know how to delete the question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:55:57+00:00Added an answer on May 20, 2026 at 11:55 am

    Can you post your model associations here? I think there is a problem in the way you’ve hooked up your models because you can clearly see that the query seems to be joining to the same table (inv AS Inventory ) using the same alias (the reason is is failing)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You'd think that it would be simple, isn't there something simple to do this?
Would you guys think that a master page should be part of the company's
I would like to think that some of the software I'm writing today will
This is something that I think would be very useful. Basically, I'd like there
I think everyone here would agree that in order to be considered a professional
I think most C++ programmers here would agree that polluting the global namespace is
What is the function of the namespace here? I would think in this simple
I would like to do pretty much what the Mail Application does: that when
you would think this would be obvious, but searching through documentation, SAP forums, Googling,
I have the following situation I think would be best to show in sample

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.