created function for sql where
added php option
modified to use api.php