Problem with mssql driver

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guillaume

    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("UP DATE Users SET usFirstName = 'Guillaume' WHERE usId
    = 20");
    mssql_close();

    header("Locatio n: $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




  • Jochen Daum

    #2
    Re: Problem with mssql driver

    Hi Guillaume!

    On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
    <nospam_guillau me.rouchon@free .fr> wrote:
    [color=blue]
    >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:
    >[/color]
    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.
    Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

    Comment

    • Guillaume

      #3
      Re: Problem with mssql driver

      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_messa ge_severity(0)

      So i have all mssql messages but there is none.

      Guillaume

      "Jochen Daum" <jd@jdaum.de> wrote in message
      news:v8ugkvomeu sieq13rq0tu7b46 961n722fq@4ax.c om...[color=blue]
      > Hi Guillaume!
      >
      > On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
      > <nospam_guillau me.rouchon@free .fr> wrote:
      >[color=green]
      > >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:
      > >[/color]
      > 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/[/color]


      Comment

      • Jochen Daum

        #4
        Re: Problem with mssql driver

        Hi Guillaume!

        On Sun, 24 Aug 2003 11:14:30 +0200, "Guillaume"
        <nospam_guillau me.rouchon@free .fr> wrote:
        [color=blue]
        >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[/color]

        Right. I have to look up everything on www.php.net[color=blue]
        >
        >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_erro r_severity(0)
        >mssql_min_mess age_severity(0)
        >
        >So i have all mssql messages but there is none.
        >[/color]
        What about a var_dump of the resource you get with mssql_open_db() ;?

        HTH, Jochen


        [color=blue]
        >Guillaume
        >
        >"Jochen Daum" <jd@jdaum.de> wrote in message
        >news:v8ugkvome usieq13rq0tu7b4 6961n722fq@4ax. com...[color=green]
        >> Hi Guillaume!
        >>
        >> On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
        >> <nospam_guillau me.rouchon@free .fr> wrote:
        >>[color=darkred]
        >> >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:
        >> >[/color]
        >> 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/[/color]
        >[/color]

        --
        PHP DB Edit Toolkit -- PHP scripts for building
        database editing interfaces.
        Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

        Comment

        Working...