I have php page querying from a SQL database in the following manner:
$virtual_dsn = 'DRIVER={SQL Server};SERVER=myserver;DATABASE=mydatabase';
$connection = odbc_connect($virtual_dsn,user,pass) or die('ODBC Error:: '.odbc_error().' :: '.odbc_errormsg().' :: '.$virtual_dsn);
odbc_exec($connection,mydatabase);
$query = "SELECT * FROM mytable WHERE myfield = 'Séjourné'";
$result = odbc_exec($connection, $query);
I know that there are rows in the table that should match this query but they are not being returned. I have narrowed the problem down to the "é" character; i.e. queries without that character return as expected but I am not able to query records that contain "é". I suspect the problem has something to do with the ecoding of the characters. I hoped there was some way to specify what characterset should be used for my ODBC connection or query. If there is I cannot find it.
What am I missing. Thanks.