I'm developing a PHP application that use MySQL and I wrote a class that contains the methods to access, write and read in the db.
In these methods I use the function die() if something went wrong but I cannot understand why I cannot see the string that I've gave to the function, I only see a white screen.
A more strange fact is that if I don't declare the class and I use the singles functions, the string in die is correctly visualized, I really cannot understand.
Strange behavior of function die()
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Strange behavior of function die()
Most likely you have a parse error in the class and you don't have error reporting setup correctly.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Strange behavior of function die()
Also keep in mind that `die()` will not accept numbers and that `die()` outputs `null` and `false` as empty strings. You may want to do a `var_dump()` then `die()` so you can differentiate numbers, null, false and empty strings.