Click here to Skip to main content
15,920,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am currently developing in production environment as there is no test environment for development.

The problem is whenever there is any sql error, it displays the error with database, table name on the browser to the user, which i think isn't right.

I have checked the phpinfo() and it says -

error_reporting 22527
display_errors off


I have also tried adding error_reporting(0) with no success.

<?php 

error_reporting(0);
require_once('connection.php');


mysql_select_db($db, $test);

$query =  "Select * from testtable";
$result = mysql_query($query, $test) or die(mysql_error());
$num_rows = mysql_num_rows($result);


?>

and user get the error  -

"Table 'db.testtable' doesn't exist" 


Any ideas?

Thanks
Posted

1 solution

The error_reporting only affects errors from PHP, you're displaying your own message when you call die(mysql_error())
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900