dkirk Posted May 9, 2007 Share Posted May 9, 2007 I am having a problem getting results back from a SELECT statement using the script below. The field names contain decimals and spaces and I am not sure wether or not this is causing the problem?? I am connecting to a SQL server db using ODBC, first time connecting to SQL server but have been using ODBC to connect to Access db's for years. I have entered the field names just as they are in the table and I have tried replacing the spaces and decimals with underscores but still recieve the same error. Anyway, my simple script and the error that I am recieveing is below. Any help would be greatly appreciated.. $connect = odbc_connect('cabngsql', '', ''); if (!$connect) { echo "couldn't connect"; exit; } $query1 = "SELECT fol no FROM Protocol.folder"; $result1 = odbc_exec($connect, $query1); while (odbc_fetch_row($result1)){ $folder = odbc_result($result1, 1); echo "$folder"; } ?> ERROR: SQL error: [Microsoft][ODBC SQL Server Driver][sql Server]Invalid object name 'Protocol.folder'., SQL state S0002 in SQLExecDirect Quote Link to comment https://forums.phpfreaks.com/topic/50674-php-odbc-sql-server-select-statement-options/ Share on other sites More sharing options...
hollettster Posted May 27, 2008 Share Posted May 27, 2008 I am having a similar problem. If you find the answer, please share. Quote Link to comment https://forums.phpfreaks.com/topic/50674-php-odbc-sql-server-select-statement-options/#findComment-551075 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.