Three queries returning 1 row each So.. I've got:

3 DB  Queries returning 1 row each ....

SELECT value FROM ja_settings WHERE varname='clickatel_api_id' 
SELECT value FROM ja_settings WHERE varname='clickatel_user' 
SELECT value FROM ja_settings WHERE varname='clickatel_pass'


Could be re-written as:

SELECT value, 'clickatel_api_id' AS name FROM ja_settings WHERE varname='clickatel_api_id'
UNION ALL
SELECT value, 'clickatel_user' AS name FROM ja_settings WHERE varname='clickatel_user'
UNION ALL
SELECT value, 'clickatel_pass' AS name FROM ja_settings WHERE varname='clickatel_pass' ;


1 db query that returns 3 rows ...  (there's even better ways than a union... I know).
This would eliminate 2 db server roundtrips on ALL pages.

How could I write this Query?
Thank you!
I guess you want something like this:

SELECT value, varname
FROM ja_settings 
WHERE varname IN ('clickatel_api_id', 'clickatel_user','clickatel_pass');