Well, here's the idea. I am creating a shell controller and view (I am using CodeIgniter). I can write one view and one controller that can control many different master tables for data entry. The differences between the various tables can be stored in a table. So, if I want to run the "customers" page, I can query the database to get all the information I need to run the customers page. Among the things that are different from table to table is the SQL select I will have to run the retrieve data for the page. So, one of the columns in the "pages" table is the SQL Select I will run in order to retrieve a specific customer record. By data driving the specific page information, I can save a lot of time in development.
So, I will have a field called cRowSQL and it could have, as a string, the following SQL Select:
SELECT customer.id, customer.name, customer.address, customer.city, customer.state, customer.zip, SUM(invoices.totalamount) as sales
FROM customer
LEFT OUTER JOIN invoice ON invoice.idcustomer = customer.id
WHERE customer.id = '$id'
I want to retrieve the SQL select and replace in the $id with the real value so I can get the row I want.
If I were writing the code directly, I would encase the string in a double quote and it would evaluate the variable immediately. I want the same functionality except I am not storing it as a liternal string into SQL code variable. I am trying to figure out how to do that...
Does this help?