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

SQLize | PHPize | SQLtest

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

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table test(id int auto_increment, num int, PRIMARY KEY (id), unique (num)); insert into test(num) values(1), (2), (3); SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = 'test'; select * from test; insert into test(num) values(3) on duplicate key update num = 5; SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = 'test'; select * from test; insert into test(num) values(7) on duplicate key update num = 5; SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = database() AND TABLE_NAME = 'test'; select * from test;

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

Copy Clear