<?php
// includes the file that contains data for connecting to mysql database, and PDO_MySQLi class
include('../conn_mysql.php');
// creates object with connection to MySQL
$conn = new PDO_MySQLi($mysql);
// CREATES TABLE
$sql = "CREATE TABLE `testclass` (`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `url` VARCHAR(255), `title` VARCHAR(125), `dt` INT(11) NOT NULL) CHARACTER SET utf8 COLLATE utf8_general_ci";
// executes the SQL query, passing only the string with SQL query
$resql = $conn->sqlExecute($sql);
// check if the SQL query succesfully performed, else, outputs error message
if($resql) echo 'The table "testclass" succesfully created.';
else echo $conn->error;
|