Mysql Where Query... Little help needed

Discussion in 'PHP' started by SuperexX, Jan 16, 2009.

  1. #1
    So normally the mysql query will be

    $result = mysql_query("SELECT * FROM Persons
    WHERE FirstName='Peter'");


    is there a way to do it so that we can where another query

    for example

    WHERE FirstName='Peter' and WHERE LastName='John'

    ??
     
    SuperexX, Jan 16, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    that is exactly how you do it except for the second where.

    WHERE FirstName='Peter' and LastName='John'
     
    Colbyt, Jan 16, 2009 IP