Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Peter Robinson: "As a tech savvy company director, I wanted an inexpensive web based database application to manage all aspects of my business. As with most humans I find developing purely by CLI very hard and do not have the will or time to invest in improving my skills. I was looking to find a nice human friendly GUI to design and build my application, which is when I came across PHP Generator for MySQL.

Whilst you still need a great understanding of logic and a small amount of programming ability to get the specific results you require, I am very happy with the speed of progress I have been making with this invaluable tool.

With all the standard libraries included, this product makes normal requirements such as JavaScript form validation, lookup selectors, on click events, auto complete, detailed searches, multiformat exports, rss feeds and username security straight forward and quick.

Having any changes made via the GUI written to the web server at the click of a button makes testing out ideas quick and easy without fear of breaking your application.

To conclude, I couldn't find any other product on the market that came close to offering the amount of options this does, and I do hope that more products like this come out in the future, with the hope of eventually eradicating the need to program all together".

Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Custom SQL queries

To use a SELECT query as a page data source, click the Create Query button or select the corresponding popup menu item, specify the query name and text, and click OK.

 

Rules for creating queries used by PHP Generator

All queries must satisfy the simple requirement: the following query must be correct.

 

select * from

(

  QUERY_TEXT_YOU_ENTERED

) an_alias

 

This happens because the software uses similar queries for internal needs. In case such SQL expression is not valid, the wizard marks the query as invalid and displays its name in red.

 

To meet this requirement, make sure that all the columns in the result dataset have unique aliases. For example, the following query works fine itself, but returns a dataset with two columns named id:

 

SELECT 

         table1.*, 

         table2.* 

FROM table1, table2 

WHERE table1.id = table2.id;

 

This is the reason the wizard marks this query as invalid. To solve the problem, provide these columns with unique aliases:

 

SELECT 

         table1.id as table1_id, 

         table2.id as table2_id

FROM table1, table2 

WHERE table1.id = table2.id;

 

Creating updatable datasets (For Professional Edition Only)

To get an updatable dataset based on an SQL query, you have to provide up to three SQL queries: UPDATE, INSERT, and DELETE to be able to modify, add and remove records accordingly. The first query provides an UPDATE statement for modifying existing records; the second query provides an INSERT statement to add a new record to the tables; and the third one provides a DELETE statement to remove the records. Each of these queries can contain several parameterized statements that use parameters like :field_name.

 

Example

Assume that we have the following SELECT statement:

 

SELECT 

   id, 

   first_name, 

   last_name

FROM customer

WHERE last_name LIKE 'A%'

 

To create an updatable dataset based on this query, INSERT, UPDATE and DELETE statements can be specified as follows:

 

INSERT INTO 

   customer 

VALUES (:id, :first_name, :last_name);

 

UPDATE customer 

SET    id = :id, 

   first_name = :first_name, 

   last_name = :last_name

WHERE id = :OLD_id;

 

DELETE FROM customer 

WHERE id = :id;

 



Prev Return to chapter overview Next