Ajax Scripts, PHP, Javascript, HTML & CSS – Sevenscript.net
Premium Web Templates & Scripts

Ajax Powered MySQL Table Viewer

MyAjax is a MySQL Ajax Table viewer which allows for sorting, searching, and viewing of large amounts of MySQL table data in a quick and easy to use Ajax web interface. MyAjax features Ajax Sortable Columns, Ajax Search, and Ajax Paginated Results. Uses jQuery for Ajax calls and Javascript functions. Config file includes customisation variables to set which fields to display and their default sort order, which field to search on, results per page and more. Click to view MyAjax Demo.

MyAjax Feature List:

MyAjax Uses:

The download includes demo code and instructions of how to set this up on your website. config.php is all you need to edit to have it up and running within 5 minutes of downloading.

Ajax Powered MySQL Table Viewer

  • Number of Downloads: 137
  • Number of Files: 14
  • Total File Size: 31.2kb
  • Compatible Browsers: IE6, IE7, IE8, Firefox 2.5+, Opera, Safari
$15


Posted by admin in JavaScript, PHP Scripts on 27 August, 2009 | 10:50
Search by tags: , , , , ,
  1. PhilN

    good script, thanks!

  2. Wayne

    Add in the optional ability to do inline edits and I’d pay $50 for that. ;) Good stuff!

  3. fabricio

    The inline edit feature would be awesome…I would be happy paying more for this feature too.

  4. Giuseppe

    Yes!!! This script is perfect, but…I would like to add, modify, and remove the records. If You can add this option, please contact me!

    • Sevenscript

      Thanks for your suggestion, we are working on adding an inline edit feature to this script, it should be available to download within the next few weeks.

  5. Jonathan

    Very Nice!

    Is it possible to have a “search” button instead of loading each time we add a letter?

    • Sevenscript

      Yes no problem, just add the following code to index.html, and remove the onkeyup event for the “searchText” input.

      1
      <input type="button" onclick="searchTable($('searchText').val());" />
  6. Matt

    I was wondering how easy it would to show records with a scroll up/down instead of showing the records on several pages ?

    • Sevenscript

      This can be done quite simply by removing the page limit, and then editing the Ajax Table div setting a maximum height and overflow. e.g:

      1
      <div id="ajaxTable" style="height: 800px; overflow: auto;"></div>
  7. angel0405

    Please also let me know when the inline edit feature will be available.

  8. Ryan

    In addition to the text search I’d like to be able to narrow the results by adding additional search fields, such as a dropdown for the model. Can this be done?

    • Sevenscript

      Yes this can be done quite easily, to search the table for a specific term just use the Javascript function:

      1
      searchTable('your search string')

      So if you add an onchange event to your drop down like this:

      1
      onchange="searchTable($(this).val());"

      That should create the desired effect.

  9. Will

    absolutely loving this script. so simple and so powerful!

    well worth the money (and quite a lot more in my view).

    i am just wondering if it’s possible to have it update on pressing enter, rather than onkeyup.

    is this possible?

    • Sevenscript

      This should work for you. Remove the onkeyup event handler from the search input in index.html. Then add this bit of code into ajaxTables.js:

      1
      2
      3
      4
      5
            $('#searchText').keyup(function(e) {
            if(e.keyCode == 13) {
            searchTable($('#searchText').val());
            }
            });

      This uses a bit of jQuery to capture the key press and if it is an enter/return will perform the search for you.

  10. Raul

    Could be a column to show pictures in each row? ie I have a column of pictures and I would like to see those pictures in each row

  11. Andy

    Hi

    I was wondering if you could have 2 or more search boxes. For example to have a date range or something similar.

    • Sevenscript

      Yes you should just be able to duplicate the search input as many times as you like, searching for a range of dates would be more involved than just specifying a search string though but I’m sure it’s possible.

  12. Torben

    Hi,

    what about..
    1) fix column width for each column
    2) pictures
    3) pictures with links (e.g. submit button)
    4) default sorting (e.g. lowest price)

    Torben

    • Sevenscript

      Hi Torben,

      1) At the moment each columns width is fluid and the table wrapped by a container div so that it is flexible around different sized content. That said it would be a nice feature to define column width in the config file, this is is something we will look at in our next update.
      2) Pictures will come in our next update.
      3) The next update you will be able to define a column as HTML so that it can include links and forms from within a cell.
      4) This can already be done, in config.php there is an option for default sort column, and default sort order.

  13. Jason

    What’s the status of the latest update? I think this is a great tool and have implemented it on one of my sites but can’t wait for the inline editing and the other mentioned features.

    Also, has there been any thought behind opening up a forum on this site and letting folks create their own mods to this script?

    • Sevenscript

      A new version will be available within the next couple of weeks, we want to make this as useful as possible to people so have taken time to add the features that have been requested. The forum is a possibility, we are focussing on getting the next few scripts and updates available first, then we will see about a forum if it will be of use to people.

  14. Greg

    I was wondering before I purchase if there is a way to make it search across multiple fields instead of just one?

  15. Wayne

    Hi, great script just couple of questions.

    1)Is it possiable to have the script search a field but keep it hidden (IE i use this script on a movie website and would like it so the search can look for “Alt_title” but i dont want the alt title to be displayed?)

    2)How would i go about using more than 1 mysql table in a search (like table join or something along them lines)

    3)How do i call a row variable so i can manipilate it to do things like display the “Title” in Bold or if value of rating is =>10 Show (recommended etc)

    • Sevenscript

      1) In the config file you can define which field the Ajax Search is performed on, so you can set it to “Alt_title”, even if it is not displayed. You can also list which fields to be shown in the config file.

      2) table.php is where the MySQL data is queried and displayed in a table. You could potentially add a JOIN onto the query on line 76, I haven’t tested this but it would go something like:

      1
      $sql = "SELECT $select_fields, new_table.* FROM $table JOIN new_table ON $table.id = new_table.id $order_by LIMIT $start, $pageLimit";

      3) Formatting a column could be done with Javascript, and this is something we will include in our next update. If you call the following function after the data table has loaded (put this in the $(document).ready(function() {}); bit in index.html). And specify a fieldName. This example will format a column in Bold:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
          function formatBold(fieldName) {
              $('#ajaxtb th').each(function() {
                  if($(this).text() == fieldName){
                      var colnum = $(this).parent().children().index($(this));
                  }
                  $('#ajaxtb tr').each(function() {
                      $('td', this).each(function() {
                          if($(this).parent().children().index($(this)) == colnum){
                              $(this).html('<b>' + $(this).text() + '</b>');
                          }
                      });
                  });
              });
          }
  16. alex

    Hello, can I search by todays date?

    Thanks!
    Alex

  17. Alexander

    Amazing! Just what I was looking for! And i just bought it :)

  18. joe

    looks like what i want.. how easy is this to set up for someone who knows almost nothing about mysql? i have tried setting up countless number of similar table viewers but so far havent been able to figure out how to get them to work.

    • Sevenscript

      So long as you have a MySQL database setup, this script can just be dropped on to your webserver once specifying the table you wish to view and access details in the config file.

LEAVE A COMMENT