PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table records ( `id` int not null auto_increment, `text` text, primary key(`id`) );
Copy Clear
Copy Format Clear
<?php $text = $_GET['text']; $query = "insert into records (text) values (?);"; $stmt = $pdo->prepare($query); $stmt->execute([$text]); $query = "select * from records;"; $stmt = $pdo->prepare($query); $stmt->execute(); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); print_r($data);
Show:  
Copy Clear