PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SET @sqlList = NULL; SET @query = NULL; SELECT GROUP_CONCAT( DISTINCT CONCAT('GROUP_CONCAT(IF(`property` = "', `property`,'", `value`, NULL) ORDER BY `mp_sort`, `mp_id`, `m_sort`, `m_id`) AS "',`property`,'"') ORDER BY `mp_sort`, `mp_id`, `m_sort`, `m_id` ) INTO @sqlList FROM `shop_v_model` WHERE `entity` = "user"; SET @query = CONCAT(' CREATE VIEW `shop_v_model_user` AS SELECT `entity`, `title`, `description`, ', @sqlList, ' FROM `shop_v_model` WHERE `entity` = "user" GROUP BY `title`, `description`, `entity` ORDER BY `title` ASC '); -- SELECT @query; PREPARE stmt FROM @query; EXECUTE stmt; DEALLOCATE PREPARE stmt;
Copy Clear
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 = "SELECT VERSION() as version;"; // get DB version using PDO $stmt = $pdo->prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); printf('DB version (PDO): %s ' . PHP_EOL, $row['version']); // 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($query); printf('DB version (Laravel Query Builder): %s ' . PHP_EOL, $version[0]->version);
Show:  
Copy Clear