Reputation: 9627
there are already some applications available which "understand" the mysql protocol and to which it's possible to connect using a mysql client -- for example: you can connect to the sphinx search engine using the (an) mysql client, mysql-proxy understands the mysql-protocol, too. etc.
now i wonder if there is an implementation available in/for PHP so you could connect to some server-application implemented in PHP using the mysql client? i am looking for some PHP library (or extension) which implements the mysql protocol.
thanks, harald
Upvotes: 5
Views: 1286
Reputation: 5410
There are some software available that seems to do what we need. I did not use them yet, but eager to try, so I'll get back to you later.
Upvotes: 1
Reputation: 36503
I'm not aware of an existing pure php implementation of a mysql server. I expect it would be slower than a C/C++ counterpart. Additionally, php has always been annoying to run as a daemon.
However, should you wish to implement a server, you may wish to look at http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol. It defines the protocol for client-server communications.
Upvotes: 1
Reputation: 3102
Do you mean a scenario like: You have a system, that does not have a mysql library but you want to be able to talk to the mysql server. To do that, you want to use PHP as a proxy to talk to the database?
If your existing system can do http requests, you might want to create a restful service in php and access that restfull service. PHPRest might be what you are looking for.
Keep in mind, that this is probably slow, compared to a direct database call.
Upvotes: 0