My code looks like this:
<?php
define("ERROR", "SOMETHING WRONG WITH MY DATABASE");
...
if (!mysql_query($q)){
die(ERROR);
}
?>
Now I want to replace "SOMETHING WRONG WITH MY DATABASE" with mysql_error()in case I want to debug it. what is the easiest way?
This does not work: define("ERROR", mysql_error());
---- edit ---
I do not want to use mysql_error () in a production environment, can this help an attacker figure out something related to my database? What is my constant string usage point
like in C you can do
#define x yourfunction()
I'm not sure if I can do the same in php
source
share