Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 102 [code] => 102 [2] => [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ''. [message] => [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ''. ) ) SELECT categories.*, areasCats.name aName, areasCats.id area_id FROM categories LEFT JOIN areasCats ON categories.url = areasCats.url WHERE categories.url = '\'+ sURL +\''