PHP MySql Web Hosting

PHP and MySQL Web Development

Then create a script file loop.sql that contains

Filed under: MySQL Solutions — webmaster @ 4:12 pm

Then create a script file loop.sql that contains the following lines (be sure each line ends with a semicolon): UPDATE counter SET depth = depth + 1; SELECT depth FROM counter; SOURCE loop.sql; Finally, invoke mysql and issue a SOURCE command to read the script file: % mysql cookbook mysql> SOURCE loop.sql; The first two statements in loop.sql increment the nesting counter and display the current depth value. In the third statement, loop.sql sources itself, thus creating an input loop. You’ll see the output whiz by, with the counter display incrementing each time through the loop. Eventually mysql will run out of file descriptors and stop with an error: ERROR: Failed to open file ‘loop.sql’, error: 24 What is error 24? Find out by using MySQL’s perror (print error) utility: % perror 24 Error code 24: Too many open files 1.17 Telling mysql to Read Queries from Other Programs 1.17.1 Problem You want to shove the output from another program into mysql. 1.17.2 Solution Use a pipe. 1.17.3 Discussion An earlier section used the following command to show how mysql can read SQL statements from a file: % mysql cookbook < limbs.sql mysql can also read a pipe, to receive output from other programs as its input. As a trivial example, the preceding command is equivalent to this one: % cat limbs.sql | mysql cookbook Before you tell me that I've qualified for this week's "useless use of cat award,"[5] allow me to observe that you can substitute other commands for cat. The point is that any command that

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by PHP MySQL Web Hosting