php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5083 odbc_do & odbc_exec cause a general error.
Submitted: 2000-06-16 16:30 UTC Modified: 2000-08-20 02:34 UTC
From: bill_hardeman at adventure dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.0 Release OS: Debian Linux 2.2.14
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bill_hardeman at adventure dot com
New email:
PHP Version: OS:

 

 [2000-06-16 16:30 UTC] bill_hardeman at adventure dot com
In PHP3, the odbc_do or odbc_exec worked fine in this script.  With PHP4, the only way to get the script to work is to run odbc_prepare and odbc_execute.

<HEAD>
    <TITLE>
        NetWork MSSQL Database
    </TITLE>
</HEAD>
<BODY BGCOLOR=white>
<?
	$dsn = "dsn=clientele";
	$odbcuser = "ctel";
	$odbcpasswd = "";
	$odbcCurType = "SQL_CUR_DEFAULT";
	/* Create the connection */
	$odbc_connect_id = odbc_connect($dsn, $odbcuser, $odbcpasswd, $odbcCurType);
	$sql_query = "SELECT * FROM clientele.ctel.techfullname";
//	$result = odbc_do($odbc_connect_id, $sql_query);	/* failed */
//	$result = odbc_exec($odbc_connect_id, $sql_query);	/* failed */

// this works
	$result_id = odbc_prepare($odbc_connect_id, $sql_query);
	odbc_execute($result_id);
	odbc_result_all($result_id, "border=3");

?>

</BODY>
</HTML>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-16 16:46 UTC] kara at cvs dot php dot net
Please give more information:
What drivermanager / driver do you use?
Where does the "general error" occur, are there odbc/php error
messages or does apache coredump (assuming you are using the
PHP module)

 [2000-06-16 17:29 UTC] bill_hardeman at adventure dot com
Driver Manager = Openlink v3.2 multi-tier
The error is:
Warning: SQL error: [OpenLink][ODBC][Driver]General error, SQL state S1000 in SQLExecDirect in /var/home/www/database/mssql/odbc_test.php on line 16

Apache v.1.3.12 (static install of PHP4)shows no error message.

 [2000-08-01 23:11 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-08-12 03:27 UTC] ahill@php.net
Hi,

This tests as fixed in the 4.0.1pl2 cut.

Best regards,
Andrew Hill
Openlink Technial Support
 [2000-08-20 02:34 UTC] sniper@php.net
User reported this fixed in 4.0.1pl2.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 04:01:38 2025 UTC