Yes another newbie.... 🙂
I'm trying to make sense of SQL and what I actually want to do is use OR and AND in my WHERE clause, but I don't think this is possible, so if anyone out there can show me a way of achieving what I want to do I'd be v.grateful!
I'm creating an employee directory where users can add their details but the Status column will be flagged as 'Added' until an admin changes the Status to 'Live'. So on searching the system, end users should only be able to see results that are flagged as 'Live'. However, with the query I have at the moment, results are displayed whatever they are flagged as:
SELECT ID,Firstname,Surname,JobTitle,Telephone,Department,LocationID
FROM employees
WHERE Firstname LIKE '%varName%' OR Surname LIKE '%varName%' AND Status = 'Live'
Any suggestions? Before I tear my hair out..?