Jump to content

[SOLVED] PHP MySQL vs exec MySQL


The Little Guy

Recommended Posts

Using exec would be several times slower. Php first has to invoke an instance of the operating system command line processor. The operating system command line processor takes the exec() command line, parses it, and invokes the mysql command line processor. The mysql command line processor parses the sql command(s), formats the low level commands for the mysql server and "calls" the mysql server to execute the commands. Then you must use some slow parsed/tokenized/interpreted php code to parse through the string returned to detect errors or parse through the textual results to get the data into a usable format.

Using exec would be several times slower. Php first has to invoke an instance of the operating system command line processor. The operating system command line processor takes the exec() command line, parses it, and invokes the mysql command line processor. The mysql command line processor parses the sql command(s), formats the low level commands for the mysql server and "calls" the mysql server to execute the commands. Then you must use some slow parsed/tokenized/interpreted php code to parse through the string returned to detect errors or parse through the textual results to get the data into a usable format.

 

Yeah, I mean, parsing the results alone would be several times slower than mysql_query.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.