Languages - PHP
Queries

Before running a query, your program must first connect to the database. Using the query results is covered separately and assumes that you already know what is described on this page.


Using MySQL, queries are fairly simple. However, I prefer a significantly more complex method This is a suggested call sequence - because white space is ignored, the query string is broken up onto several lines to improve readability. The final close quote and semicolon are placed on a line by themselves to simplify adding additional lines. This is the function - while still simple, it does a lot. Full details of the debug architecture are presented at Debug Tips. The following summarizes the important variables. The idea is to set the 3 control variables based on command line (url) parameters.


Author: Robert Clemenzi
URL: http:// mc-computing.com / Languages / PHP / Queries.html