When I try this code I don't even get an error message but when I do a var_dump
I get bool(false)
. So is there a syntax error preventing the connection?
$conn=odbc_connect('sample_db','','');
echo odbc_error($conn);
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);
echo var_dump($rs);
Or maybe I'm just doing it wrong. I'm trying this in PHP 5.2 and a 2008 server.
UPDATE: After using print_r(error_get_last()); it generates this message:
Array ( [type] => 2048 [message] => odbc_connect() [function.odbc-connect]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-4.0/DST' instead [file] => removed [line] => 2 )
Can this really prevent the odbc connection?