473,395 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem with mssql driver

Hello,
I have a strange problem while using mssql server driver:
when i update/insert in/delete a table and want to redirect after, i have
the following error message:

CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

The strange thing is that if i do a select or use mysql driver (with select,
insert, delete or update) i have no problem. Also if i update a none
existant row (ie usId = -1) there is no problem.
Here is a sample code that produce the error :

<?php
$conn = mssql_connect($server, $user, $password);
mssql_select_db($db);
$result = mssql_query("UPDATE Users SET usFirstName = 'Guillaume' WHERE usId
= 20");
mssql_close();

header("Location: $redirect");
exit();
?>

When i call this page, the database is updated and my browser goes to the
$redirect page but displays the aboved error message instead of the page.

System infos:
os : windows 2k server sp3
web: iis 5.0
php: 4.3.2
db : sql server 2000 entreprise sp2

Anyone knows the cause of this problem and/or how to resolve it ?

Thanks,
Guillaume


Jul 16 '05 #1
3 5441
Hi Guillaume!

On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
<no**********************@free.fr> wrote:
Hello,
I have a strange problem while using mssql server driver:
when i update/insert in/delete a table and want to redirect after, i have
the following error message:

What is the output of

mssql_error() and error_reporting(E_ALL); before the redirect? Most
probably there is a problem with your query.

When you then redirect, the server thinks the error messages are part
of the HTTP headers.

HTH, Jochen
--
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #2
Hi Jochen,
There is no mssql_error() function but i found this function in the doc :

mssql_get_last_message -- Returns the last message from server

This function returns the string "Changed database context to 'Agenda'."
which is the message generated by the mssql_select_db() function. So there
is no error during the update (i also tested the return value of
mssql_query() and it isn t FALSE).
The error_reporting(E_ALL); function doesn t change anything (no error
reported).
I also sets theis 2 functions :

mssql_min_error_severity(0)
mssql_min_message_severity(0)

So i have all mssql messages but there is none.

Guillaume

"Jochen Daum" <jd@jdaum.de> wrote in message
news:v8********************************@4ax.com...
Hi Guillaume!

On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
<no**********************@free.fr> wrote:
Hello,
I have a strange problem while using mssql server driver:
when i update/insert in/delete a table and want to redirect after, i have
the following error message:

What is the output of

mssql_error() and error_reporting(E_ALL); before the redirect? Most
probably there is a problem with your query.

When you then redirect, the server thinks the error messages are part
of the HTTP headers.

HTH, Jochen
--
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/

Jul 16 '05 #3
Hi Guillaume!

On Sun, 24 Aug 2003 11:14:30 +0200, "Guillaume"
<no**********************@free.fr> wrote:
Hi Jochen,
There is no mssql_error() function but i found this function in the doc :

mssql_get_last_message -- Returns the last message from server
Right. I have to look up everything on www.php.net
This function returns the string "Changed database context to 'Agenda'."
which is the message generated by the mssql_select_db() function. So there
is no error during the update (i also tested the return value of
mssql_query() and it isn t FALSE).
The error_reporting(E_ALL); function doesn t change anything (no error
reported).
I also sets theis 2 functions :

mssql_min_error_severity(0)
mssql_min_message_severity(0)

So i have all mssql messages but there is none.
What about a var_dump of the resource you get with mssql_open_db();?

HTH, Jochen
Guillaume

"Jochen Daum" <jd@jdaum.de> wrote in message
news:v8********************************@4ax.com.. .
Hi Guillaume!

On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
<no**********************@free.fr> wrote:
>Hello,
>I have a strange problem while using mssql server driver:
>when i update/insert in/delete a table and want to redirect after, i have
>the following error message:
>

What is the output of

mssql_error() and error_reporting(E_ALL); before the redirect? Most
probably there is a problem with your query.

When you then redirect, the server thinks the error messages are part
of the HTTP headers.

HTH, Jochen
--
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/


--
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #4

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

Similar topics

7
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
7
by: John Fabiani | last post by:
Hi, Since this is (sort of) my second request it must not be an easy solution. Are there others using Python to connect MsSQL? At the moment I'd accept even a windows solution - although, I'm...
6
by: Murtix Van Basten | last post by:
HI all, I am trying to migrate a database from mysql to mssql2k. I use myODBC to connect to mysql server to pull the database from DTS and insert in to sql server. But in mysql server, there is...
6
by: Swami | last post by:
Hi, I have installed MQ SQL Server 2000 on my laptop and trying to use SPRINTA 2000 JDBC Driver (inetmssql.jar) to connect to the local db. I wrote a sample Java app to test the connection and I...
16
by: davemateer | last post by:
Hi We have a current system: Linux / Apache / PHP4.x talking to Microsoft SQL 2000 Thinking about going to: Windows 2003 / PHP4.x talking to the same Microsoft SQL 2000 box...
9
by: dunleav1 | last post by:
Does enabling/disabling Data Execution Prevention have a performance impact on SQL 2000 or SQL 2005? For SQL best performance - how should I configure for: Processor Scheduling: Programs or...
0
by: doron.almog | last post by:
anybody know which driver to use to make a linked server connection between MSSQL 2005 and Access 2007
1
by: mkepick | last post by:
migrated databases from sybase to mssql, migration exported sybase written queries written with the application build in query tool and imported to mssql databases. all db and tables migrated...
0
by: Gosth in the shell | last post by:
Hi there, i need some help I got a software to backend is MSSQL 2005, but a provider software requires an UPDATE on his table with MySQL 5.0.56a backend, so i made the next: download and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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,...

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.