Store Slide Show information in a MySql database and show Slide Show in a browser.


This class was designed in 2009 and was updated April 2015 to new HTML5 and CSS3 features. It was updated again Jan. 2023.


Either download the ZIP file or install with Composer.

  1. unzip the zip file (you have probably already done this if you are reading this)
  2. the directory structure is as follows: If you loaded this with 'composer' instead of from the ZIP then this stucture is under 'vendor/bartonlp/mysqlslideshow/'.
  3. In either case you may need get *mysql* running and then:
    CREATE DATABASE mysqlslideshow;

    Create the database table. The file 'mktable.sql', in the 'examples' directory, if sourced within the 'msql' client will make the table 'mysqlslideshow'. If you want to call your table something else you can edit the 'mktable.sql' file and then either edit the 'mysqlslideshow.class.php' (NOT RECOMMENDED), or use the constructor with the additional optional arguments: The first three arguments come from the 'dbclass.conectioninfo.i.php' file. Add the forth and fifth arguments for your database name and table name.

    $ss = new MySqlSlideshow($Host, $User, $Password, 'YourDatabaseName', 'YourTableName');

    Or edit 'dbclass.connectioninfo.i.php' and add '$Database' and '$Table' and add them to the invocation above instead of the strings. You can create the table from inside the 'mysql' client by using the source statement:

    source mktable.sql;

    or just do it the hard way by typing in the create statement.

  4. add some images to your database table. There are two easy ways to do this:
    1. use the 'addupdateimage.php' program in the 'examples' directory.
    2. use the 'addimages.php' program in the 'examples' directory.
  5. try out the examples 'serverside.php' and 'browserside.html' on your own server. Then start writing your own code. Have fun. If you don't have Apache running you can use the PHP server. Just enter
    php -S localhost:8080

    from the project directory and then in your browser enter


    or 'browserside.html' to see the sites.

    Any questions can be sent to I will try to answer reasonable questions.


There are three files in the 'examples' directory:

'mysqlslideshow.classs.php' is the Ajax target and has the MySqlSlideShow class.


The class is hosted at as well as the 'PHP Classes'

Copyright © 2009-2023 Barton Phillips OR

Last Modified Jan. 27, 2023