php - cakephp query apply has many conditions run time -


Help me create a query in cakephp

  Table User ID name 1 jaskaran 2 Jaswinder 3 games id games here 1 chess 2 cricketer 3 hockey 4 other user_games user_id game_id 1 1 2 1 3 2 4 3 2 2 1 Now in the user model I have applied with user_games There are many  

Now users With the discovery of any user like name and game - where name = "% jus%" and game_id = 1

  $ this-> User- & gt; Search ('All', array ('conditions' => Array ('user.name' = & gt; '% jas%', 'game.game_id' => 1)));  

My game. Game_id status is not working How do I implement it?

Your condition is Game.id , game.games_id < / Strong> No, you do not have a game in the model game_id model.

  $ it-> User- & gt; Search ('All', array ('conditions' = & gt; array ('username' = & gt; '% jas%', 'Game.id' => 1)));  

Comments