title: how to put if else condition in LIMIT mysql
body: <p>here is my query </p>
  
  <pre><code>$where_or = " 
                  AND
                      content_status = 'Active'
                  AND
                      content_post_status = 'published'
                  AND
                      deleted = 0
                  AND
                      content_type = '$type'
                  ORDER BY content_created_at DESC ";
  
          $select = "content_id, content_title, content_short_description, content_url, content_created_at";
  
          $query = $this-&gt;db-&gt;query("
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 54
                      $where_or
                      LIMIT 3
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 55
                      $where_or
                      LIMIT 2
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 56
                      $where_or
                      LIMIT 2
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 57
                      $where_or
                      LIMIT 1
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 58
                      $where_or
                      LIMIT 1
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 60
                      $where_or
                      LIMIT 1
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 61
                      $where_or
                      LIMIT 1
                  )
                  UNION ALL 
                  (
                      SELECT $select
                      FROM tbl_content
                      WHERE 
                      content_category_id = 118
                      $where_or
                      if content_type = 'article'
                      begin 
                          LIMIT 10
                      end
                  )   
          ");
  </code></pre>
  
  <p>You can see in last UNION i want to put limit on if condition ..but its giving me error...how can i do that...please help..</p>