This topic is locked
[SOLVED]

 custom sql query

1/4/2010 4:03:31 AM
PHPRunner General questions
T
titanic author

Say I want to perform a custom SQL query and see the results on the webpages.
Do I need to create a dummy view for this?... Cause I should send result of the query to a variable like "$result" to see on page with "before display operation" ...
or is there any other way?
thanx in advance...

A
alang 1/4/2010

Three options:

  1. Base the page on one of your tables. You can add other tables into the query to get the fields you want.
  2. Create a view in PHPR (which just copies an existing table to start with) and add tables as above. The view in PHPR essentially lets you have multiple different pages based on one database table.
  3. Create a view in the database. This is best for read-only views or really complex SQL with subqueries etc. The downside is that you will need to add all the code yourself to write data back to the database if you want to add/edit records.

T
titanic author 1/5/2010



Three options:

  1. Base the page on one of your tables. You can add other tables into the query to get the fields you want.
  2. Create a view in PHPR (which just copies an existing table to start with) and add tables as above. The view in PHPR essentially lets you have multiple different pages based on one database table.
  3. Create a view in the database. This is best for read-only views or really complex SQL with subqueries etc. The downside is that you will need to add all the code yourself to write data back to the database if you want to add/edit records.


thanx...just wanted to be sure...