PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table `table` (id int, name varchar(64)); insert into `table` values (123, 'Test123');
Copy Clear
Copy Format Clear
<?php $bb = '[id]123[/id]'; $id = preg_replace('/\[id\](.+)\[\/size\]/isU', '', $bb); echo $bb . ' >>> ' . $id . PHP_EOL; $query = 'select id, name from `table` where id = ?;'; $stmt = $pdo->prepare($query); $stmt->execute([$id]); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); print_r($rows);
Show:  
Copy Clear