PHP Extension Idea

Talk about anything in here.
Post Reply
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

PHP Extension Idea

Post by bowersbros »

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.
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: PHP Extension Idea

Post by jacek »

I actuality started work on somethign like this a while ago.

It wasn't an extension though, it was a file you had to include.

I might get back to it actually.
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: PHP Extension Idea

Post by bowersbros »

Care to share current progress?

I recently fell ill in India, so have a shitload of spare time while recovering :D

Either private or public, just curious as to how far you got :D
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: PHP Extension Idea

Post by jacek »

Not very far, and I just looked and don't have the source any more.

It was just a custom error handler really, http://www.php.net/manual/en/function.s ... andler.php

I tried to give a bit more useful info though.
Image
Post Reply