Professional Web Applications Themes

Problem with mssql driver - PHP Development

Hi Guillaume! On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume" <nospam_guillaume.rouchonfree.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. [url]http://sourceforge.net/projects/phpdbedittk/[/url]...

  1. #1

    Default Re: Problem with mssql driver

    Hi Guillaume!

    On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
    <nospam_guillaume.rouchonfree.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.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

  2. #2

    Default 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




    Guillaume Guest

  3. #3

    Default 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_message_severity(0)

    So i have all mssql messages but there is none.

    Guillaume

    "Jochen Daum" <jdjdaum.de> wrote in message
    news:v8ugkvomeusieq13rq0tu7b46961n722fq4ax.com...
    > Hi Guillaume!
    >
    > On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
    > <nospam_guillaume.rouchonfree.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.
    > [url]http://sourceforge.net/projects/phpdbedittk/[/url]

    Guillaume Guest

  4. #4

    Default Re: Problem with mssql driver

    Hi Guillaume!

    On Sun, 24 Aug 2003 11:14:30 +0200, "Guillaume"
    <nospam_guillaume.rouchonfree.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 [url]www.php.net[/url]
    >
    >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" <jdjdaum.de> wrote in message
    >news:v8ugkvomeusieq13rq0tu7b46961n722fq4ax.com.. .
    >> Hi Guillaume!
    >>
    >> On Sun, 24 Aug 2003 10:38:30 +0200, "Guillaume"
    >> <nospam_guillaume.rouchonfree.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.
    >> [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    >
    --
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

Similar Threads

  1. Sum and Group problem with MSSQL
    By zu in forum Coldfusion Database Access
    Replies: 2
    Last Post: June 2nd, 04:11 PM
  2. MSSQL JDBC driver bug?
    By Mountain Lover in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 16th, 01:43 AM
  3. JDBC MSSQL Driver Losing Tables?
    By John-liai in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 11th, 09:48 PM
  4. Problem with MSSQL connection and PHP
    By Doug Applegate in forum PHP Development
    Replies: 1
    Last Post: October 11th, 08:30 AM
  5. [PHP - MSSQL]: Problem with mssql_connect
    By Ongart Wongsanupa in forum PHP Development
    Replies: 1
    Last Post: September 18th, 08:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139