Hello, a bit of help please

Discussion in 'PHP' started by Crayz, Jun 3, 2007.

  1. #1
    Edit: I thought of an algorithm not 5 seconds after I made the post, so I will post back later if it works for me or not. If you don't mind though, post your codes :)


    I am trying to create a query that will collect all users out of the database that have their status field set to 1.

    So basically, if I had

    User - Status
    User1 - 0
    User2 - 0
    User3 - 1
    User4 - 1

    I would like to create an array variable that has User3 and User4 stored into it.

    Thanks!
     
    Crayz, Jun 3, 2007 IP
  2. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #2
    $result = mysql_query("SELECT * FROM tabale_name WHERE status=1")
    or die(mysql_error());
     
    YIAM, Jun 3, 2007 IP
  3. Crayz

    Crayz Well-Known Member

    Messages:
    708
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    120
    #3
    Well I wanted to put them into an array, but i'v got my code for this.

    I am using the mysql_fetch_array function, this should have came to my head first thing when I needed to code this.

    Anyways, thanks guys.
     
    Crayz, Jun 3, 2007 IP