Improved sql.php to allow both array and strings