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

  • SEARCH
  • Home
  • 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 8953613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:08:14+00:00 2026-06-15T14:08:14+00:00

Can anyone can tell me what is wrong with this $paramcari is the value

  • 0

Can anyone can tell me what is wrong with this

$paramcari is the value that needs to be search for, it should be the data with the a.status not 0 and not 2 but the filter doesn’t work, the output always show all status whether it is 0 , 0 or 2… what did I miss?

$sql="select a.*, b.*, d.*,  e.*, f.*, j.*, k.*, DATE_FORMAT(a.tgldaftar,'%d %b %Y %H:%i') as tgldaftar,
      DATE_FORMAT(a.tglkeluar,'%d %b %Y %H:%i') as tglkeluar , i.*
      from daftar a
      INNER JOIN  pasien  b ON a.noRM=b.noRM 
      INNER JOIN  ranjang d ON a.idranjang=d.idranjang 
      INNER JOIN  ruang e ON d.idruang=e.idruang 
      INNER JOIN  kelas  j ON e.idkelas=j.idkelas 
      INNER JOIN  instalasi  k ON e.idinstalasi=k.idinstalasi
      INNER JOIN (select idjenispasien , jenispasien  from jenispasien ) f ON a.idjenispasien=f.idjenispasien 
      INNER JOIN rujukan i ON a.idrujukan=i.idrujukan and a.status !=0 and a.status != 2";

if($paramcari != ""){
    $sql.=" and b.nama like '%$paramcari%'  ";
    $sql.=" or j.namakelas like '%$paramcari%'  ";
    $sql.=" or e.namaruang like '%$paramcari%'  ";
    $sql.=" or b.idRM like '%$paramcari%'  ";
    $sql.=" or i.namars like '%$paramcari%'  ";
    $sql.=" or a.nodaftar like '%$paramcari%'  ";
}   

$sql.="ORDER BY a.tgldaftar ASC limit  $start,15   ";   
  • 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-15T14:08:15+00:00Added an answer on June 15, 2026 at 2:08 pm

    Your search condition and a.status !=0 and a.status != 2 is appended to the last inner join condition. It should be in a where condition instead. Change the last join to

    INNER JOIN rujukan i ON a.idrujukan=i.idrujukan
    where a.status !=0 and a.status != 2";
    

    Also add braces to your search condition, because and has higher precedence than or

    if($paramcari != ""){
        $sql.=" and (b.nama like '%$paramcari%'  ";
        ...
        $sql.=" or a.nodaftar like '%$paramcari%') ";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone tell me what's wrong with this code? class Dataset < ActiveRecord::Base has_many
Can anyone tell me what's wrong with this code? It's giving me an error
Can anyone tell me what is wrong with this code? public abstract class BoardTestBean{
Can anyone tell me why this code would not be working? $('body').on('test', function() {
can anyone tell me what is wrong with this code: CC = C:\Program Files\Microsoft
Can anyone please tell me what is wrong with this script. I am a
Can anyone tell me what's wrong in this code: #!/usr/local/bin/python import os import string,
Can anyone tell me what is wrong with this Query ? UPDATE violetta.navi__stop SET
Please can anyone tell me what's wrong with this MySQL query SELECT count(items.id) AS
Can anyone tell me whats wrong in this method and why it gives a

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.