Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.