With phpYouDo (PYD), the development of Database Driven WebApps (DDWA) with PHP gets standardized, clearly arranged and last but not least: mainly outsourced to the client.
Intro slideshow (move along with cursor-keys)
An application in phpYouDo consists of one or more reports. Reports in turn consists of one or more database queries. Each query can get visualized with an individual HTML or PHP template.
- SQL and HTML separation from PHP code
- Easy integration of user-input from GET (:), POST (#) and SESSION ($) into SQL queries
- Conditional execution of SQL queries by using mandatory user-input or by scripted preconditions
- Executing the same SQL query multiple times till an end-condition matches
- Can manage multiple applications
- Execute your reports from the commandline (f.i. as cronjob)
When to use phpYouDo?
- The focus of your application is on the database
- You plan to integrate multiple developers with different skills (PHP Dev, Database Dev, Design Dev)
- Your fellow developers are PHP beginners but might be Database professionals
- Your business logic is in the database
- You need an administrative gui — quick!
- You want no "coded application", but a transparent one
Server: PHP with PDO
Simple copy the index.php to any place you want on your webserver and start app-development!
Q: Can PYD handle multiple databases in one application?
A: Yes, see the examples.
Q: What sorts of databases PYD can handle?
A: Only relational ones. PYD uses PHP Data Objects to access databases.
Q: The examples use SQLite databases only. How to use MySQL?
A: Example db.ini.php for MySQL:
type=mysql host=localhost database=mydb username=myuser password=mypwd
Q: How can SQL statements be debugged?
A: The execution of each section inside a report can be logged by adding the key log with a value of 1 or 2: 1 means a full log, while 2 logs only the time spent on the execution of the query. The log-entries are published in your PHP error-logfile.
;... [get\_required] ; Only gets executed when the lorem parameter is set: sql="SELECT * FROM lipsum WHERE lorem=:lorem*" log=1 ;...
[26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required GET params: application,report,lorem [26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required POST params: [26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required SQL params: get_lorem [26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required SQL param values: 3 [26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required Obligatory params: get_lorem [26-May-2014 14:02:42 UTC] PYD example_01_intro\get\get_required Seconds needed for binding params and executing query: 0.00011682510375977
Debugging SQL-statements with MySQL
Make use of the General Query Log.
Alternatives or additions to phpYouDo
Glossary and abbreviations
DDWA: Database Driven Webapp
Application: A set of reports
Report: A set of queries
Subreport: A report within a report
Query: An SQL statement
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.