473,480 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sybase & PHP

Hi,

I had trouble using FreeTDS with Sybase ASE 12.5.2 DE. I kept getting errors when trying to run a stored
procedure, using the PHP program found at the end of this post.
php: dblib.c:303: buffer_add_row: Assertion `row_size <=
buf->element_size' failed.
Aborted
But now having uninstalled FreeTDS, and trying to connect to my databases, I can no longer connect.
PHP Warning: sybase_select_db(): Sybase: A link to the server could not be established in ...
What do I have to do to connect PHP to Sybase?

I also have downloaded iAnyWhere and installed it, but I don't know if I needed it or not, or if
it can even help.

Very confused. Do I need to re-install FreeTDS or is there a lib already in Sybase?
( Using Sybase ASE 12.5.2 DE )

Thanks in advance!

My last configure command:

../configure \
--with-apache2=../httpd-2.0.53 \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-openssl \
--with-mysql \
--with-dbase \
--with-ttf \
--with-curl \
--with-gd \
--with-gnu-ld \
--with-module=so \
--with-zlib \
--with-sqlanywhere=/opt/sybase/SYBSsa9/ \
--with-sybase=/opt/sybase/OCS-12_5 \
--with-mcrypt
Test Program: ( worked fine with SQL but not stored procedures when FreeTDS was installed )

<?php

$servername = "my-server-here" ;
$portnumber = "5000" ;
$username = "sa" ;
$password = "" ;
$database = "master" ;

$db = sybase_connect("$servername:$portnumber","$usernam e", "$password");
sybase_select_db ( "$database" );
$q = sybase_query("sp_server_info", $db);

# $q = sybase_query("${database}..sp_help", $db);
# $q = sybase_query("select * from sysobjects", $db);

$syb_num_fields = sybase_num_fields( $q ) ;
$syb_num_rows = sybase_num_rows( $q ) ;

$row_cnt = 0 ;
$field_cnt = 0 ;

while($row = sybase_fetch_row($q))
{
if ( $row_cnt == 0 )
{
for ( $f=1; $f<=$syb_num_fields;$f++)
{
$info = sybase_fetch_field($q);
print "[$info->name]";
if ( $field_cnt == $syb_num_fields )
{
print "\n" ;
$field_cnt = 0 ;
}
}
print "\n" ;
}

++$row_cnt ;
$field_cnt = 0 ;
while(list($k, $v) = each($row))
{
++$field_cnt;
$datum = NULL ;
$datum = rtrim ( $v ) ;
print "[$datum]" ;
if ( $field_cnt == $syb_num_fields )
{
print "\n" ;
$field_cnt = 0 ;
}
}
}
sybase_close ( $db ) ;

?>

Jul 17 '05 #1
0 1650

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1532
by: Josh Close | last post by:
I'm getting these errors almost every time I use sybase. I'm using it with mssql. I build it like so: python setup.py build_ext -D WANT_THREADS -D HAVE_FREETDS -U WANT_BULKCOPY python setup.py...
0
1209
by: Dave Cole | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This...
0
1181
by: Jim Douglas | last post by:
Do they play well together? Anyone using the Sybase .NET provider. Any problems or should I stick with the Sybase OLEDB? Or worse check with the DataDirect folks for their .NET provider for...
0
1285
by: Jim Douglas | last post by:
Anyone using the 12.5 .NET provider from Sybase? We are using the 12.5 OleDB and have issues and Sybase is recommending that we move up to the .NET provider. If you are using the .NET provider from...
2
2873
by: eight02645999 | last post by:
hi i am writing a CGI to process some database transactions using the Sybase module. so in my CGI script, i have: .... import Sybase import cgitb; cgitb.enable(display=1 ,...
1
8299
by: db2sysc | last post by:
All, We have listed out the INBUILT Function differences between Sybase and DB2. Kindly provide your feedback or corrections and for CHANGES - DO WE NEED TO CODE our own UDFs?
3
3588
by: Alex Murphy | last post by:
As title, Thanks
0
1370
by: =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is...
0
1475
by: =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.