Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
create table utf8mb3 (str varchar(255)) character set utf8; insert into utf8mb3 values ('foo');

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $pdo->query("set names utf8mb4"); try { $pdo->query("select * from utf8mb3 where str='😂'"); } catch (Throwable $e) { echo $e->getMessage(),"\n"; } $pdo->query("ALTER TABLE utf8mb3 CONVERT TO CHARACTER SET utf8mb4"); $pdo->query("select * from utf8mb3 where str='😂'"); echo $pdo->query("show create table utf8mb3")->fetch()[1];
Copy Clear