#41910 [Opn->Fbk]: mysql_error doesn't return a string, just dumps output to screen
ID: 41910 Updated by: [EMAIL PROTECTED] Reported By: dan at novapulsar dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: centos4.3 PHP Version: 4.4.7 New Comment: Just put the default php.ini instead of yours and change settings one by one to see which one causes it. Previous Comments: [2007-07-06 15:50:01] dan at novapulsar dot com Can log file settings be affecting the way this is working? I've tried this on multiple servers, and this seems simple enough to work, but yet it doesn't. Do you want a link to a phpinfo page on the server this is being run on and/or a copy of php.ini in a link? [2007-07-06 15:43:20] [EMAIL PROTECTED] /local/dev/php/4_4> ./sapi/cli/php /tmp/5.php Error on page: this.php -> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from nothing this is broken' at line 1 I don't see any problems here. [2007-07-06 15:37:17] dan at novapulsar dot com Sorry, early in the morning, I meant mysql_query(). [2007-07-06 15:35:53] [EMAIL PROTECTED] What is mysql_execute()? [2007-07-06 15:30:24] dan at novapulsar dot com " . $x_error); //save to db } } ?> The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41910 -- Edit this bug report at http://bugs.php.net/?id=41910&edit=1
#41910 [Opn->Fbk]: mysql_error doesn't return a string, just dumps output to screen
ID: 41910 Updated by: [EMAIL PROTECTED] Reported By: dan at novapulsar dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: centos4.3 PHP Version: 4.4.7 New Comment: /local/dev/php/4_4> ./sapi/cli/php /tmp/5.php Error on page: this.php -> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from nothing this is broken' at line 1 I don't see any problems here. Previous Comments: [2007-07-06 15:37:17] dan at novapulsar dot com Sorry, early in the morning, I meant mysql_query(). [2007-07-06 15:35:53] [EMAIL PROTECTED] What is mysql_execute()? [2007-07-06 15:30:24] dan at novapulsar dot com " . $x_error); //save to db } } ?> [2007-07-06 09:06:51] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. [2007-07-06 05:03:25] dan at novapulsar dot com Description: Since mysql_error() is documented to 'return' a string, I assumed it would be safe to put it in either a string, or as an argument to an error handling function. Reproduce code: --- function fn_Save_Error ($x_page_url, $x_error) { if (strlen($x_page_url) && strlen($x_error)) { //output if debugging is on echo ("Error on page: " . $x_page_url . " -> " . $x_error); //save to db } } $strSQL = "select all from something will make an error duh"; $objResult = mysql_query ($strSQL) or die (fn_Save_Error('this.php', mysql_error()); Expected result: Expected result is that the string value of mysql_error() is passed as an argument of datatype string whether blank or with contents to the fn_Save_Error function. Actual result: -- Mysql_error() is output directly to the screen/console, instead of being passed as a value to fn_Save_Error for custom error handling. Based on the mysql_error() documentation it should not output the error to screen, it should return it as a string, so that I could do this: ...some wrong query execution... $error_message = mysql_error(); echo ($error_message); $error_message should be == to $mysql_error, but instead it just outputs to screen/console -- Edit this bug report at http://bugs.php.net/?id=41910&edit=1
#41910 [Opn->Fbk]: mysql_error doesn't return a string, just dumps output to screen
ID: 41910 Updated by: [EMAIL PROTECTED] Reported By: dan at novapulsar dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: centos4.3 PHP Version: 4.4.7 New Comment: What is mysql_execute()? Previous Comments: [2007-07-06 15:30:24] dan at novapulsar dot com " . $x_error); //save to db } } ?> [2007-07-06 09:06:51] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. [2007-07-06 05:03:25] dan at novapulsar dot com Description: Since mysql_error() is documented to 'return' a string, I assumed it would be safe to put it in either a string, or as an argument to an error handling function. Reproduce code: --- function fn_Save_Error ($x_page_url, $x_error) { if (strlen($x_page_url) && strlen($x_error)) { //output if debugging is on echo ("Error on page: " . $x_page_url . " -> " . $x_error); //save to db } } $strSQL = "select all from something will make an error duh"; $objResult = mysql_query ($strSQL) or die (fn_Save_Error('this.php', mysql_error()); Expected result: Expected result is that the string value of mysql_error() is passed as an argument of datatype string whether blank or with contents to the fn_Save_Error function. Actual result: -- Mysql_error() is output directly to the screen/console, instead of being passed as a value to fn_Save_Error for custom error handling. Based on the mysql_error() documentation it should not output the error to screen, it should return it as a string, so that I could do this: ...some wrong query execution... $error_message = mysql_error(); echo ($error_message); $error_message should be == to $mysql_error, but instead it just outputs to screen/console -- Edit this bug report at http://bugs.php.net/?id=41910&edit=1
#41910 [Opn->Fbk]: mysql_error doesn't return a string, just dumps output to screen
ID: 41910 Updated by: [EMAIL PROTECTED] Reported By: dan at novapulsar dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: centos4.3 PHP Version: 4.4.7 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: [2007-07-06 05:03:25] dan at novapulsar dot com Description: Since mysql_error() is documented to 'return' a string, I assumed it would be safe to put it in either a string, or as an argument to an error handling function. Reproduce code: --- function fn_Save_Error ($x_page_url, $x_error) { if (strlen($x_page_url) && strlen($x_error)) { //output if debugging is on echo ("Error on page: " . $x_page_url . " -> " . $x_error); //save to db } } $strSQL = "select all from something will make an error duh"; $objResult = mysql_query ($strSQL) or die (fn_Save_Error('this.php', mysql_error()); Expected result: Expected result is that the string value of mysql_error() is passed as an argument of datatype string whether blank or with contents to the fn_Save_Error function. Actual result: -- Mysql_error() is output directly to the screen/console, instead of being passed as a value to fn_Save_Error for custom error handling. Based on the mysql_error() documentation it should not output the error to screen, it should return it as a string, so that I could do this: ...some wrong query execution... $error_message = mysql_error(); echo ($error_message); $error_message should be == to $mysql_error, but instead it just outputs to screen/console -- Edit this bug report at http://bugs.php.net/?id=41910&edit=1