Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

データベースに接続、テーブル作成

use hoge;

で接続。テーブル一覧は

show tables;

で見れる。テーブル作成例。

create table 'hoge_messages' (`id` int(10) auto_increment not null comment 'id', `user_id` int(10) not null comment 'ユーザID', `name` varchar(255) default NULL comment 'チャットネーム', `body` varchar(255) default NULL comment 'チャット本文', `created` datetime comment 'created', `modified` datetime comment 'modified', constraint `chat_messages_PKC` primary key (`id`)) comment 'チャット' ;