Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP connection to Sybase DB...

Status
Not open for further replies.

jxfish2

Technical User
Jan 24, 2002
183
US
I'm trying to connect to a Sybase database, using PHP.

I'm not getting any syntax errors, or any errors for that matter.

It appears as if I might be connecting to the database, but nothing else seems to work, after the initial connection.

Once the connection is made (if it's really made), none of my debugging statements, echo / print, etc. work...

If I put in an erroneous sybase_connect statement, or an invalid database, I get an error...

But, when the database is correct, I just get a blank webpage... Or it's blank, from the point where the database connection is made... (Anything before the connection is displayed as it's supposed to be, on the webpage...)

Here's an excerpt from my PHP script:

<?php
$SERVER = 'VHost_in_interfaces_file';
$UID = 'user';
$PWD = 'user_passwd';

print &quot;$SERVER $UID $PWD&quot;;

@$db = sybase_connect($SERVER,$UID,$PWD);
$query = &quot;select name from sysobjects where type = 'U'&quot;;
@$result = sybase_query($query,$db);
print &quot;result equals: $result&quot;;
?>

NOTE: All output seems to stop, right after the &quot;@$db =&quot; line...

Any help would be greatly appreciated...

TIA

JoeF
 
I noted someone else's MySQL code, and modified my sybase query, to reflect their code:

<?php
$SERVER = VHost_in_interfaces_file';
$UID = 'user';
$PWD = 'user_passwd';

print &quot;$SERVER $UID $PWD&quot;;

sybase_connect($SERVER,$UID,$PWD);
sybase_select_db(&quot;db_name&quot;);
$query = &quot;select name from sysobjects where type = 'U'&quot;;
$result = sybase_query($query);
print &quot;result equals: $result&quot;;
sybase_close();
?>

After modifying the code, I received the following error:

Fatal error: Call to undefined function: sybase_connect() in /home/~user/public_html/main.php on line 37

Could this mean that PHP isn't compiled to work with Sybase?

What else could possibly be wrong?

Again, any help would be greatly appreciated...

JoeF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top