ID: 11057
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: ODBC related
Operating system: Windows 98 SE
PHP Version: 4.0.4
Description: Premature end of script headers: c:/php/php.exe

I probably recognized the problem, my scripts generates sql queries like this 
(non-problematic version):

$query = "select count(*) cnt from tab01, tab11 where login='"
.$login.
"' and tab01.client_id = tab11.client_id and passwd=password('".$psswd."')";

I changed, so it should not be case sensitive for "login".

$query = "select count(*) cnt from tab01, tab11 where login='"
.strtolower($login).
"' and tab01.client_id = tab11.client_id and passwd=password('".$psswd."')";

but this didnt work, i tried also to convert to lowercase before using the converted 
string and that was also wrong.

$login = strtolower($login);

and then i used the first query.

So when I dont use converted strings, my functions works good, but when I use them, 
there is a problem described above.

Previous Comments:
---------------------------------------------------------------------------

[2001-05-23 12:38:08] [EMAIL PROTECTED]
I probably recognized the problem, my scripts generates sql queries like this 
(non-problematic version):

$query = "select count(*) cnt from tab01, tab11 where login='"
.$login.
"' and tab01.client_id = tab11.client_id and passwd=password('".$psswd."')";

I changed, so it should not be case sensitive for "login".

$query = "select count(*) cnt from tab01, tab11 where login='"
.strtolower($login).
"' and tab01.client_id = tab11.client_id and passwd=password('".$psswd."')";

but this didnt work, i tried also to convert to lowercase before using the converted 
string and that was also wrong.

$login = strtolower($login);

and then i used the first query.

So when I dont use converted strings, my functions works good, but when I use them, 
there is a problem described above.

---------------------------------------------------------------------------

[2001-05-23 10:10:16] [EMAIL PROTECTED]
I tried to modify the functions so they have the same parametres as ODBC_functions and 
it works..

I didnt write before, that the only two functions, that are problematic, are Fetch_row 
and Result, other works properly.

---------------------------------------------------------------------------

[2001-05-23 14:25:18] [EMAIL PROTECTED]
Im using Apache 1.3.14. I have problem with ODBC_functions, but I dont know why, 
problems appeared without any changes in source codes (related to the ODBC_functions).

I have predefined functions for ODBC_connect, ODBC_close, ODBC_query, ODBC_Fetch_Row 
and ODBC_result (written below). 
These functions are written in library.php, which is inherited in scripts by require.

require "library.php"


When Im using my functions, php crashes whith "premature end of script headers in 
c:/php/php.exe", but when Im using normal ODBC_functions, is everything allright. 
However it has been working normally, then "something happened" and it doesnt work.


        function connect()
        {
                @$con = ODBC_connect("MySQL","","");
                if(!$con) 
                {
                        $error=1;
                        include "error.php";
                }
                return $con;
        }

        function Query ($query)
        {
                global $conn;
                return ODBC_exec($conn, $query);
        }
        
        function Fetch_row ()
        {
                global $result;
                return ODBC_Fetch_Row($result);
        }
        
        function Result($field)
        {
                global $result;
                return ODBC_Result($result, $field);
        }


---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=11057


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to