I assume, that you already have phpunit installed and added into PATH.
Create guestbook database in mysql.
Create guestbook table in that database.
File src\Guestbook.php
<?php| function createDb() { | |
| var db_name = 'jabber'; | |
| var db_version = '1.0'; | |
| var db_describe = 'Bro,its jabber'; | |
| var db_size = 2048; | |
| var db = openDatabase(db_name, db_version, db_describe, db_size, function(db) { | |
| console.log(db); | |
| console.log("Database opened Successfully! Or created for the first time !"); | |
| createTable(db); | |
| }); |
| <?php | |
| /** | |
| * PDO Singleton Class v.1.0 | |
| * | |
| * @author Ademílson F. Tonato | |
| * @link https://twitter.com/ftonato | |
| * | |
| */ | |
| class DB { |
| <?php | |
| /** | |
| * Created by PhpStorm. * User: Faizan Khan * Date: 1/2/2018 * Time: 10:51 AM | |
| */ | |
| /*Script Motive: The purpose of the file is to present different PDO Functions for DML and DDL operations | |
| Sample Table | |
| Table Name: UserTbl | |
| Columns: Id, UserName, Email, RecordAddDate | |
| */ |
| <?php | |
| /* | |
| * PDO DATABASE CLASS | |
| * Connects Database Using PDO | |
| * Creates Prepeared Statements | |
| * Binds params to values | |
| * Returns rows and results | |
| */ | |
| class Database { | |
| private $host = DB_HOST; |
TL;DR do what the last section tells you to do
An absolute path is one which includes all path components from the root of the file system. It starts with a leading
/ on unix-like operating systems, or a drive letter on Windows.
Unix: /full/path/to/file.php
Windows C:\full\path\to\file.php