-1

I wanna ask some question to all master here, i have 1 table tuser with field id,username,password,name,and status.

I am doing this query

select * from tuser where status = 'on' order by nama asc

and I list the array who has 'on' at page and works.

In this case I want to list the user but not list him/her self.

In example : john and ray, when john and ray login, john see the himself to at list and I dont want john has appears.

Niinii
  • 83
  • 3
  • 10

1 Answers1

1

add additional consition on your WHERE clause

select * 
from tuser 
where status = 'on'  AND
      username <> 'john'         -- or name. i don't know what columnName is it
order by nama asc
John Woo
  • 258,903
  • 69
  • 498
  • 492
  • are you using `PHP`? please see this [Best way to prevent SQL injection](http://stackoverflow.com/questions/60174/best-way-to-prevent-sql-injection) – John Woo Nov 25 '12 at 15:52