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

  • Home
  • SEARCH
  • 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

My problem is one that you would think is quite common, but I haven't
You'd think that it would be simple, isn't there something simple to do this?
You would think that launching a bat file from Java would be an easy
From what I've read from Herb Sutter and others you would think that volatile
I would like to know if ParseExact is faster than Parse. I think that
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
I would like to do pretty much what the Mail Application does: that when
Say I have a simple model like these (small part of a pretty large
^Question^ I think that it would be too complex to open a database. Does
I am trying to write a very thin hypervisor that would have the following

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.