Jump to content

Archived

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

lynxus

ODBC refuses to work! Im gonna scream

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);

 

 

?>

 

 

 

Share this post


Link to post
Share on other sites
Its installed!

# rpm -qa | grep odbc

php-odbc-5.1.6-3

 

But is it enabled? Check the output of a phpinfo() script.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hi,

Ive got a phpinfo output, It mentions odbc, what should i be looking for?

 

Share this post


Link to post
Share on other sites

No worrys

 

Ive found i can use mssql instead of odbc and this dns shiznit.

 

Ty yall.

Share this post


Link to post
Share on other sites

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