SQL Query module in php extension