PHP Extension Idea
Posted: Sat Feb 25, 2012 8:54 am
I've just thought. Since a majority of errors on here are things like 'mysql_result expects parameter 1 to be given' or whatever, and its usually a typo in either a field or a table name.
IS it possible for us to write a php extension that will run that check?
So, if a mysql error is encountered. It will run through the default settings of checking:
username and password are correct.
Connection is made (as above, and host is correct)
if host is incorrect (eg. locallhost is typed) then it recognises that it is actually spelt wrong, and 'assumes' that it should have been localhost, and outputs that instead.
if username or password are wrong, there isnt really a way to tell that so just standard error output of username / password incorrect.
Then get to the stuff where each mysql error has an ID, and each ID has a 'usual' problem, so we can do checks for each problem.
I think it will help alot of people, im only curious as to whether it would have a large speed issue or not.
But since we can probably get it to run only when mysql_errors occur it might not be too much of a problem.
IS it possible for us to write a php extension that will run that check?
So, if a mysql error is encountered. It will run through the default settings of checking:
username and password are correct.
Connection is made (as above, and host is correct)
if host is incorrect (eg. locallhost is typed) then it recognises that it is actually spelt wrong, and 'assumes' that it should have been localhost, and outputs that instead.
if username or password are wrong, there isnt really a way to tell that so just standard error output of username / password incorrect.
Then get to the stuff where each mysql error has an ID, and each ID has a 'usual' problem, so we can do checks for each problem.
I think it will help alot of people, im only curious as to whether it would have a large speed issue or not.
But since we can probably get it to run only when mysql_errors occur it might not be too much of a problem.