March 30th, 2002, 12:04 PM
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;)
In page 3:
There is a typo in the 2nd last text:
// set error-reporting to only fatal errors
$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('',
// 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.
January 16th, 2003, 12:23 PM
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
Can you suggest resolution?
I also notice you make call mysql_query($query, $db) but my ver4 php barfs with
the $db. ???
April 16th, 2003, 05:14 AM
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
April 16th, 2003, 05:16 AM
Ok, it seems that this comments engine rips out single quotes and makes the text a different style instead. Sorry.
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 .
If you would like to see an article covering a particular topic, please post your request here.