June 26th, 2007

Edit MySQL database tables with PHP and AJAX

Every week I look at the PHP Classes newsletter to see if there are any cool new submissions. This one is perhaps the most exciting and promising that I've seen in a while!

I blogged a while ago about a PHP Datagrid class. Basically, it's an easy way to interact with the data in a table (view, add, modify records), without having to build an interface from scratch. However, the class turned out to be a pain to implement, I never got it to work fully.

So, my next venture will be to implement this new class: DBNavigator.

Like the PHP Datagrid class, it can be used to browse and modify data in a MySQL database. The cool difference is that is uses an AJAX interface to edit, insert, and search the MySQL database tables! I was looking for a demo on the author's site, but couldn't find it (the site's in Italian). But it boasts some cool features:

  • Update and delete multiple records at once.
  • Prevent editing/deleting records by simultaneous users (locking).
  • Records can be data-bound to form inputs.
  • Javascript for browser-side validation, as well as server-side validation.
  • Uploading files to specific folders, and ensuring that the uploaded files don't exist already.
  • List and search for records to be edited or deleted. Search fields support AJAX based auto-complete suggestions. Search results can be saved to CSV files.
  • Pagination (paging) links in tables with different colors or CSS styles for different rows.

Hopefully this one will be easier to implement!

5 Responses to ' Edit MySQL database tables with PHP and AJAX '

Subscribe to comments with RSS or TrackBack to ' Edit MySQL database tables with PHP and AJAX '.

  1. lizzardS said,

    on June 29th, 2007 at 2:21 pm

    I tried to no avail. Good luck to you tho. I was suckered in by the ideal of NOT having to customize an interface every time I add a new field to a DB that really should be managed by that department and not me. I cutcopyandpaste a lot of code and then just hack it to work for that particular department - but that gets ugly after awhile. Best of luck

  2. Lawrence Keen said,

    on October 12th, 2007 at 9:44 am

    Get urban sniper 2 and treasure of cutlass reef

  3. Anon said,

    on January 8th, 2008 at 6:20 pm

    It's quite easy to implement. It proves to be very useful too.

  4. sean said,

    on January 17th, 2008 at 3:49 pm

    i got it work
    its pretty cool i am going to modify it with new css and better data. notice that the export feature doesn't work. i have had that issue before and got it to work on my own. i don't really know if its that cool. i haven't decided yet. let me know if u have any questions on how to implement. heres how i did it.
    1) Get the HTMLFORM Class
    2) Get the Pagenavigator class
    3) Get the dBNavigator class
    4) put all the files in the same folder
    5) put all the images in an img folder
    6) create the tables in the .sql file provided
    7) change the dB connection strings in example_full.php and index.php
    8) rock and roll

  5. Rukmangathan said,

    on March 14th, 2008 at 4:29 am

    hi
    i need code for using multiple tables(add,edit,delete) in ajax with php

Leave a reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image