Jump to content

ODBC refuses to work! Im gonna scream


lynxus

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.