MySQL

MySQL based PHP session handling, InnoDB or MyISAM?

in


When building a serious website you should always use a database for the session handling; this has several advantages of which session sharing between web servers [load balancing] is a key feature. Usually MySQL is the database of choice for PHP programmers, when using MySQL we can choose between two table types: InnoDB or MyISAM. Which type to choose for database session handling?

Simple (secure) database object

in


When using JSON as a data transport encoding schema for MySQL the database server should always return a single row; it can be useful (even better: you should) to make use of stored functions for the generation of the JSON data on the database side. A simple database object is shown and discussed.


Note:
Article is still wip.

Firstly note that we should use constants wherever possible; in this example constants are set in the constants.php file.

The object has some specific properties:

  1. public function __construct()

JSON and MySQL


We can make an adjustment to the generally accepted use of "fetch row from database and show" by using the GROUP_CONCAT function and JSON function, since we can recursively extend the JSON data this enables us to extend the data transportation mechanism without changing the code.

Syndicate content

Back to top