First of all:
SELECT `key`, `value` FROM settings
WHERE `key` = :base_url
OR `key` = :google_analytics
OR `key` = :site_domain
Is this the right choice for multiple lines? Or is there a better way? Because itβs not really OR, but they are all ... So it just doesnβt sound right.
Question number 2:
This is my query that selects paginated users:
SELECT id, email, verified, level, name_surname, age, sex, profession, education, location, privacy, suspend FROM users LIMIT :start, :results
Sometimes I want to pass an array of users to return to this request, for example array(1,2,3,4,5).
Obviously, just adding WHERE $arraydoesn't work. So how would I do that?
Sometimes I donβt want to pass this array of identifiers, so how do I switch between a state when there is a list of identifiers and when not? Am I just creating php if else in a make statement? This seems obvious, but it's better to ask about best practices :)
user796443