You are here: PHP, ODBC, SQL Server Select Statement « PHP Programming Language « IT news, forums, messages
PHP, ODBC, SQL Server Select Statement

Posted by dkirkdrei on 05/09/07 15:33

I am having a problem getting results back from a SELECT statement
using the script below. The field names contain decimals and I am not
sure wether or not this is causing the problem or not?? 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация