books
code
firstAttack
links
quotes
sky
snow
Syntax to Remember
MySQL
CREATE TABLE tableName id INT(##) NOT NULL PRIMARY KEY AUTO_INCREMENT;
ALTER TABLE tableName ADD COLUMN (dateCreated TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
ALTER TABLE tabelName ADD COLUMN visible BOOL AFTER id;
ALTER TABLE tableName MODIFY username VARCHAR(255) NOT NULL;
ALTER TABLE tableName ADD created_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER id, ADD modified_date TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER created_date;
INSERT INTO tableName (id, name, visible) VALUES ('##', 'data', '1');
UPDATE TABLE tableName SET name='data' WHERE id='##';
Copyright © 2007-2025 by chad