PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE DSI_CAST_STATS_EPISODELIST ( EpisodeID int, ReleaseDate date, Title varchar(64), Downloads24h int, Downloads7d int, Downloads14d int ); INSERT INTO DSI_CAST_STATS_EPISODELIST VALUES (88, '2018-01-01', 'E01', 83, 146, 207), (124, '2018-01-15', 'E02', 50, 92, 156), (172, '2018-02-15', 'E03', 17, 100, 186), (303, '2018-03-15', 'E04', 92, 183, 328); SELECT * FROM DSI_CAST_STATS_EPISODELIST;
Copy Clear
Copy Format Clear
<?php $conn = &$mysqli; $sql = "SELECT * FROM DSI_CAST_STATS_EPISODELIST;"; $result = mysqli_query($conn, $sql); $data = [ 'Title' => [], 'Downloads24h' => [], 'Downloads7d' => [], 'Downloads14D' => [] ]; while ($row = mysqli_fetch_array($result)) { $data['Title'][] = $row["Title"]; $data['Downloads24h'][] = $row["Downloads24h"]; $data['Downloads7d'][] = $row["Downloads7d"]; $data['Downloads14d'][] = $row["Downloads14d"]; } var_export($data);
Show:  
Copy Clear