Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP Basics: Debugging Tips

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
729 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 22, 2011

WEBSITE: http://betterphp.co.uk/

In this video I talk about a few types of error that you will come across in PHP, and the steps to fixing them.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (betterphp)

  • I watched your configuring php tutorial which showed me how to make the proper adjustments in the php.ini file. Thank you!

  • @catherinen87 :D np.

  • 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.

see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • @betterphp Thanks I will check it out sometime :)

  • @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 I know, I panicked at the end a bit haha. Its too easy to get to 15 mins.

  • @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

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more