PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE auction ( id INT AUTO_INCREMENT, name VARCHAR(10), PRIMARY KEY (id) ); INSERT INTO auction(name) VALUES ('bar'), ('fee'), ('foo'), ('bum'), ('bu%'), ('fum'), ('boo'), ('bee');
Copy Clear
Copy Format Clear
<?php $query = 'b'; echo "Escaped: $escaped\n\n"; $stmt = $pdo->prepare("SELECT name FROM auction WHERE name LIKE :like "); $stmt->execute(['like'=>"%$query%",'test'=>'jkfdkfd']); var_export(implode(',',$stmt->fetchAll(PDO::FETCH_COLUMN)));
Show:  
Copy Clear