ID: 11057 User Update by: [EMAIL PROTECTED] Status: Closed Bug Type: ODBC related Operating system: Windows 98 SE PHP Version: 4.0.4 Description: Premature end of script headers: c:/php/php.exe Im sorry. It means, that i see windows error, that there is an error in php.exe. Web server is still working, but in the log file is written aboud premature ending of .... No HTML page is shown. Previous Comments: --------------------------------------------------------------------------- [2001-06-21 11:23:49] [EMAIL PROTECTED] no user feedback. please reopen the bug if you're still having trouble. --------------------------------------------------------------------------- [2001-06-01 13:49:08] [EMAIL PROTECTED] when you say it crashes what exactly does that mean? do you still see the web server working and that message came up? or did you get a nice core dump to show up with that statement on the screen popup? --------------------------------------------------------------------------- [2001-05-26 03:55:18] [EMAIL PROTECTED] OK, here is the part of the script. Btw. i found, that this appears only if in query is agregate function count(*) (there are two types of query, one works good, other not) Im using MySQL 3.23.27-beta with MyODBC driver. There is table tab01 with information about clients. Script: <html> <head> <title>Welcome</title> <? function connect() { @$con = ODBC_connect("sample-MySQL","",""); if(!$con) echo "not connected"; return $con; } function close () { global $conn; ODBC_close($conn); } function Query ($query) { global $conn; return ODBC_exec($conn, $query); } function Fetch_row () { global $rslt; return ODBC_Fetch_Row($rslt); } function Result($field) { global $rslt; return ODBC_Result($rslt, $field); } if ($sent) { $conn = connect(); if ($conn) { $query = "select count(*) cnt from tab01 where login='".strtolower($login)."'"; //problematic // $query = "select * from tab01 where login='".strtolower($login)."'"; //works good $rslt = query($query); while(Fetch_row()) $logged = Result("cnt"); if ($logged) echo $login; else echo "not logged"; close(); } } ?> </head> <body> <form action="default.php"> <center> <table> <tr><td>Login: </td> <td><input value="<?echo $login?>" type="text" name="login"></td></tr> <tr><td colspan="2"><center><input type="submit" value="Submit"></center></td></tr> </table></center> <input type="hidden" name="sent" value="true"> </form> </body> </html> --------------------------------------------------------------------------- [2001-05-25 10:03:06] [EMAIL PROTECTED] this really doesn't sound like a PHP problem to me. you said it yourself when "using normal ODBC_functions everything is alright" (grammer corrected). regardless of that, if you're still convinced this is a PHP ODBC error, give me a SIMPLE sample script that i can use to reproduce this (about 10 lines or so), and what database you're using. --------------------------------------------------------------------------- [2001-05-23 12:41:12] [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. --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. 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]