PHPize Online / SQLize Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE IF NOT EXISTS philaco_mots_clef_table ( `mot_clef_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `mot_clef` VARCHAR(50) UNIQUE NOT NULL ) ENGINE=INNODB; SELECT* FROM philaco_mots_clef_table;
Copy
Copy Format Clear
<?php use Carbon\Carbon; $now = Carbon::now()->format('d/m/Y'); //printf("Today is %s\nCurrent PHP version: %s \n\n", $now, phpversion()); $query = "INSERT INTO philaco_mots_clef_table (mot_clef) VALUES (?);"; $query2 = "SELECT * FROM philaco_mots_clef_table;"; // get DB version using PDO $stmt = $pdo->prepare($query); var_dump($stmt); $result = $stmt->execute(array('toto')); var_dump($result); //$row = $stmt->fetch(PDO::FETCH_ASSOC); //printf('DB version (PDO): %s ' . PHP_EOL, $row['version']); /* $stmt = $pdo->prepare($query2); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); var_dump($result); */ /* // Run query using mysqli $result = $mysqli->query($query); $version = $result->fetch_object(); printf('DB version (mysqli): %s ' . PHP_EOL, $version->version); // Select using Laravel $version = $db::select($db::raw("SELECT VERSION() as version;")); printf('DB version (Laravel Query Builder): %s ' . PHP_EOL, $version[0]->version); */
Show:  
Copy