-
Notifications
You must be signed in to change notification settings - Fork 58
How to build a PHP MySQL Application with 4 lines of code
The Xataface Application Framework allows you to convert your existing MySQL database into a full-fledged with as little as 4 lines of code. And it's Not a code generator.
This article is intended to spark interest in the Xataface Application Framework amongst PHP developers by showing how easy it is to set up a full-featured front-end for your MySQL database. If you are a PHP developer, surly you can identify with the situation where you've built a snazzy website with PHP and MySQL but you need to create some way the website users to administer it. I.e., you need to make an administrative back-end for your users.
You need to do this because PHP admin is too technical for your users, and it is an aweful lot of tedious work to create all of the necessary forms and lists for your users to edit the data themselves.
- Create, edit and delete records using simple web forms.
- Browse through database and find records without any SQL.
- Lots of great widgets for editing records including html editors, select lists, grids, checkboxes, calendars and more.
- Sort records.
- Export result sets as CSV or XML.
- Fully configurable and extendable by you to implement more features.
Here are 6 steps to a full-featured front-end for your database:
- Create a directory for your application on your webserver. Call it myapp.
- Download the latest version of Xataface and copy it into your application directory that we just created. (i.e. myapp/xataface.
- Create a configuration file named conf.ini inside your application directory (i.e. myapp/conf.ini) to store your database connection info:
[_database]
- Create an .htaccess (i.e. myapp/.htaccess) file to prevent Apache from serving your conf.ini file:
<FilesMatch "\.ini$">
- Create an index.php file (i.e. myapp/index.php) to serve as an access point for your application:
<?php
- Create a templates_c directory to store cached smarty templates or your application (i.e. myapp/templates_c, and make sure that it is writable by the webserver:
$ mkdir templates_c $ chmod 777 templates_c
That's all there is to it! Point your web browser to the index.php file we just made, and check out your new app!
Image:http://media.weblite.ca/files/photos/people-find.png?max_width=400
http://media.weblite.ca/files/photos/people-new-record.png?max_width=400
Image:http://media.weblite.ca/files/photos/people-list.png?max_width=400
- Sign up for the Xataface mailing list to receive exclusive development tips (see the left column for a signup form).
- Check out the About Xataface page for more information about features and requirements.
- Use the Getting Started Tutorial to get started making your own application.
- Watch screencasts showing Xataface in action.