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 9132285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:17:14+00:00 2026-06-17T08:17:14+00:00

I’m using cakephp 1.3 with mysql database and engine is MYISAM, I’m getting problem

  • 0

I’m using cakephp 1.3 with mysql database and engine is MYISAM, I’m getting problem in relationships. I have two tables name Organization and OrgClasses, these two are associated with mbo_studio_id which is common in both table.

organization
Id(PK), name, mbo_studio_id

org_classes
id(PK), name,date, mbo_studio_id

I’m trying to fetch data on the condition of mbo_studio_id, but it adds another condition by primary key of OrgClasses.

var $belongsTo = array(

    'OrgClass' => array(
        'className' => 'OrgClass',
        'foreignKey' => 'mbo_studio_id',
        'conditions' => array('OrgClass.mbo_studio_id' => 'Organization.mbo_studio_id'),
        'order' => 'OrgClass.date DESC',
        'dependent' => false,
    )
);

I get following query

SELECT `Organization`.`id`, `Organization`.`name, `Organization`.`mbo_studio_id`, `OrgClass`.` id`,`OrgClass`.`mbo_studio_id`, `OrgClass`.`name`, `OrgClass`.`date`
FROM `organizations` AS `Organization` 
LEFT JOIN `org_classes` AS `OrgClass` ON (`Organization`.`mbo_studio_id` = `OrgClass`.`id` AND `OrgClass`.`mbo_studio_id` = Organization.mbo_studio_id) 

Here I don’t want Organization.mbo_studio_id = OrgClass.id condition in query.

Thanks

  • 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-06-17T08:17:16+00:00Added an answer on June 17, 2026 at 8:17 am

    Then you need to set foreignKey to false:

     'foreignKey' => false,
    

    This way it will only use your custom conditions.

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

Sidebar

Related Questions

I am using CakePHP framework with MySQL database and I have problem in saving
I have a CakePHP 1.3 website with a MySQL database. The problem is that
I have a site set up using CakePHP and MySQL and I want to
Using CakePHP 1.3 I'm trying to save some data to a MySQL database. The
I have A MySQL database currently in production use for a CakePHP application A
I have a web application that has been done using Cakephp with MySql as
I have a very strange problem using CakePHP 2.2.4 , let me explain what
Using CakePHP 1.3 I developed engine for blog with posts and comments tables and
Im using cakephp 2.0 and i have data submitted that i want to cleanup,
I'm using cakephp 2.1.3 and I have a table Ingredients and a table IngredientAliases

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.