#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    germany
    Posts
    1
    Rep Power
    0

    Good piece of information


    Pretty good article - though I knew about most of the features of error handling it was really good to read this article as it took the problems back in my mind and gave an interessting overview. I'm really looking forward to the second part;)
    regards,
    flim
  2. #2
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Irony


    In page 3:
    http://www.devshed.com/Server_Side/PHP/ErrorHandling/ErrorHandling1/page3.html
    There is a typo in the 2nd last text:

    <?php
    // set error-reporting to only fatal errors
    error_reporting(E_ERROR);

    // string
    $string = "Mary had a little lamb";

    // attempt to join() this string
    // this will generate an E_WARNING
    // because the second argument to join() must be an array join('',
    $string);

    // since this is a non-fatal error
    // this statement should be executed
    echo "-- end --";
    ?>

    There should be a line break at the comments where half of the join function gets commented.
  4. #3
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    error


    Read your article. I get MySQL result resource error when trying to execute "
    $query="UPDATE $dbtable SET companyname='$companyname', address='$address', city='$city', state='$state',

    zipcode='$zipcode', countrycode='$countrycode', companyphone='$companyphone', contactperson='$contactperson',

    contactphone='$contactphone', companyIP='$companyIP', catalogIP='$catalogIP', companyemail='$companyemail',

    contactemail='$contactemail', logo='$logo' WHERE recnum='$recnum'";

    which appears to be ok symatically.
    using error trap causes my form to go
    blank.
    Can you suggest resolution?
    I also notice you make call mysql_query($query, $db) but my ver4 php barfs with
    the $db. ???
    Thanks
    Bruce
  6. #4
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    re: error


    SQL queries will not work unless all text fields are enclosed in quotes. ie:

    $query = "UPDATE $dbtable SET companyname = '$companyname', address = '$address', ..."

    Number fields don't need quotes, and inserting NULL doesn't need quotes. In fact if you use quotes NULL won't work properly.

    Hope that helped. Dom
  8. #5
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Apologies


    Ok, it seems that this comments engine rips out single quotes and makes the text a different style instead. Sorry.
  10. #6
  11. No Profile Picture
    Ducani
    Guest
    Devshed Newbie (0 - 499 posts)

    Error Handling In PHP (part 1)


    Error Handling In PHP \(part 1\)

    So you've seen those ugly messages PHP pops up whenever there's an error in your code. And perhaps you've wondered if there's a way to turn them off, or capture and handle them at the application layer. Well, there is - and this article has all the details.

    Please discuss this article in this thread. You can read the article here .
  12. #7
  13. No Profile Picture
    Ducani
    Guest
    Devshed Newbie (0 - 499 posts)
    If you would like to see an article covering a particular topic, please post your request here.

IMN logo majestic logo threadwatch logo seochat tools logo