search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Change from sqllite to MS SQL

Related article: HTML5 Scheduler
Asked by Anonymous
7 years ago.

Can I adapt this for MY SQL backend?

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Yes, you just need to adjust the $db variable initialization in _db.php:

$db = new PDO('sqlite:daypilot.sqlite');

For MySQL you'll need to use something like this:

$host = "127.0.0.1";
$port = 3306;
$username = "username";
$password = "password";
$database = "daypilot";

$db = new PDO("mysql:host=$host;port=$port",
               $username,
               $password);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("CREATE DATABASE IF NOT EXISTS `$database`");
$db->exec("use `$database`");
Comment posted by Anonymous
7 years ago.

Thank you so much for such a swift reply.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.