lynxus Posted December 21, 2009 Share Posted December 21, 2009 Hi all, This is driving me absolutely mad! and google is not being helpful! Im trying to connect to a remote mssql server with odbc I get the error: PHP Fatal error: Call to undefined function odbc_connect() in /usr/local/scripts/testing.php on line 10 Its installed! # rpm -qa | grep odbc php-odbc-5.1.6-3 Please someone help me. This is killing me. <?php // POXY ODBC!!!!!!!!!!!!!!!!!!!!!! $conn=odbc_connect('DatabaseNameRemoved','',''); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * from users"; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} while (odbc_fetch_row($rs)) { $compname=odbc_result($rs,"RTRIM"); echo "$compname \n"; } odbc_close($conn); ?> Link to comment https://forums.phpfreaks.com/topic/185875-odbc-refuses-to-work-im-gonna-scream/ Share on other sites More sharing options...
trq Posted December 21, 2009 Share Posted December 21, 2009 Its installed! # rpm -qa | grep odbc php-odbc-5.1.6-3 But is it enabled? Check the output of a phpinfo() script. Link to comment https://forums.phpfreaks.com/topic/185875-odbc-refuses-to-work-im-gonna-scream/#findComment-981792 Share on other sites More sharing options...
roopurt18 Posted December 21, 2009 Share Posted December 21, 2009 Not sure if this helps you or not, but there is a library called ODBTP for talking to MS SQL. My coworker uses it in all his projects and swears by it. You may want to take a peek at it. Link to comment https://forums.phpfreaks.com/topic/185875-odbc-refuses-to-work-im-gonna-scream/#findComment-981823 Share on other sites More sharing options...
lynxus Posted December 22, 2009 Author Share Posted December 22, 2009 Hi, Ive got a phpinfo output, It mentions odbc, what should i be looking for? Link to comment https://forums.phpfreaks.com/topic/185875-odbc-refuses-to-work-im-gonna-scream/#findComment-982151 Share on other sites More sharing options...
lynxus Posted December 22, 2009 Author Share Posted December 22, 2009 No worrys Ive found i can use mssql instead of odbc and this dns shiznit. Ty yall. Link to comment https://forums.phpfreaks.com/topic/185875-odbc-refuses-to-work-im-gonna-scream/#findComment-982159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.