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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:17:56+00:00 2026-06-13T23:17:56+00:00

actually, i want to meet this sql requirement: … where (type_id = 6 OR

  • 0

actually, i want to meet this sql requirement:

… where (type_id = 6 OR type_id = 8) and status = 2 ….

but i don NOT know how to set conditions in $paginate.

var $paginate = array(
        'Student'=>array(
                    'limit' => 10,
                    'fields'=>array('Student.id','Student.firstname','Student.lastname'),
                    'order' =>array('Student.id'=>'desc'),
                    'conditions' => ?,
                ),
        );  

any one knows how to set conditions ?

  • 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-13T23:17:56+00:00Added an answer on June 13, 2026 at 11:17 pm

    Based on this site http://book.cakephp.org/1.3/view/1030/Complex-Find-Conditions
    (It’s not the lastes release, but try it)

    var $paginate = array(
            'Student'=>array(
                        'limit' => 10,
                        'fields'=>array('Student.id','Student.firstname','Student.lastname'),
                        'order' =>array('Student.id'=>'desc'),
                        'conditions' => array(
                             'Student.type_id' => array(6, 8),
                             'Student.status' => 2
                             )
                              
                    ),
            );
    

    or

    var $paginate = array(
            'Student'=>array(
                        'limit' => 10,
                        'fields'=>array('Student.id','Student.firstname','Student.lastname'),
                        'order' =>array('Student.id'=>'desc'),
                        'conditions' => array(
                              'Student.status' => 2,
                              "OR" => array (
                                   'Student.type_id' => 6,
                                   'Student.type_id' => 8
                                    )                             
                             )
                              
                    ),
            );
    

    EDIT: This second version cannot be used in this situation, because now the OR array have two elements with the same keys and will check only the last (8)

    [N.B.] Excuse me if I made some syntax error 🙂

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

Sidebar

Related Questions

Well I don't actually want to make a calendar but I need a view
yes I know it's unusual, but I actually want to turn of intellisense for
I actually want to create a new local. I know it sounds dubious, but
Looking at similar questions, I actually want the exact opposite of this: SQL query
I don't mean an alias or function. I actually want to add an entire
Actually I want to populate an array to fill up my table view, but
I actually want to achieve the following description This is the table argument I
I actually want to put some entries page in the front page, but I
I've just asked question about Task but realized that I actually want to ask
I want to do some changes in magento theme actually product detail page, but

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.