SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: SQL help

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    London, UK.
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL help

    This one must be simple... but I can't get my head around it...

    Background stuff:


    Each record has 2 fields - passed and user

    If you login as admin - you see everything - that works ok... simple enough...

    But if you login as a standard user then you only see records that have passed and your own records - regardless if they are passed or not.

    My rubbish stab at this:

    Code:
      AND (file.passed <> '0' OR file.user = '".$user."')";



    James

  2. #2
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    file.passed <> '0' or (file.user = '".$user."') or ('".$user."' = 'admin')


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •