Hi Jacek! Great video! How do you make your error messages sit at the top of your browser page and display in bold+red? My error messages intermingles with the rest of my file which I don't really like. Thanks in advance!
@catherinen87 It was at the top because it was a syntax error, any others would have been inline. To make it red you need to modify your php.ini file and set the error_prepend setting to some html to make it red. Post on the forum if you want the exact code / more info.
Very useful video! If I may add, you could include an 'or' clause to the mysql calls and combine it with mysql_error() to report the error. For example mysql_query($query) or die('Could not not execute query' . mysql_error())
"or die" may also be used with mysql_connect() and mysql_select_db() among other commands.
@n0dltr0n The reason I did not advise this is that sometimes I have used that at the resulting broken html from the die() has actually hidden the error message.
lol you got lucky that YouTube is being lenient on their times. In some of my videos before i got them extended it couldn't even go one second more or it'd reject it
@betterphp why dont you edit your videos when you go over the time? I think i remember you saying that you redid one video three times because it was being too long ?
@projecttechnet You can, but its not really a good idea, because you may as well just make sure they don't happen. If you insist though, you can create a custom error handling function, have a look on php.net at the set_error_handler() function
I watched your configuring php tutorial which showed me how to make the proper adjustments in the php.ini file. Thank you!
catherinen87 1 month ago
@catherinen87 :D np.
betterphp 1 month ago
Hi Jacek! Great video! How do you make your error messages sit at the top of your browser page and display in bold+red? My error messages intermingles with the rest of my file which I don't really like. Thanks in advance!
catherinen87 1 month ago
@catherinen87 It was at the top because it was a syntax error, any others would have been inline. To make it red you need to modify your php.ini file and set the error_prepend setting to some html to make it red. Post on the forum if you want the exact code / more info.
betterphp 1 month ago
Very useful video! If I may add, you could include an 'or' clause to the mysql calls and combine it with mysql_error() to report the error. For example mysql_query($query) or die('Could not not execute query' . mysql_error())
"or die" may also be used with mysql_connect() and mysql_select_db() among other commands.
n0dltr0n 8 months ago
@n0dltr0n The reason I did not advise this is that sometimes I have used that at the resulting broken html from the die() has actually hidden the error message.
betterphp 8 months ago
lol you got lucky that YouTube is being lenient on their times. In some of my videos before i got them extended it couldn't even go one second more or it'd reject it
RawRzCopteR 1 year ago
@RawRzCopteR I know, I panicked at the end a bit haha. Its too easy to get to 15 mins.
betterphp 1 year ago
@betterphp why dont you edit your videos when you go over the time? I think i remember you saying that you redid one video three times because it was being too long ?
RawRzCopteR 1 year ago
is there a custom way to log errors? so that it will notify you by email or something when an error has occured?
projecttechnet 1 year ago
@projecttechnet You can, but its not really a good idea, because you may as well just make sure they don't happen. If you insist though, you can create a custom error handling function, have a look on php.net at the set_error_handler() function
betterphp 1 year ago
@betterphp Thanks I will check it out sometime :)
projecttechnet 1 year ago