プログラミング初心者です。個人的なメモとして活用しています。
1環境構築をしたものの、アプリが立ち上がってもログインできない!
IDとPWが配られていない!
今までそう思っていましたがDBにIDとPWを突っ込んだらログインできたので記録として残します。
DBの接続が完了し、ID/PWが格納されているテーブルが特定されている状態とする。
UPDATE 'ID/PWが格納されたテーブル名' set 'passwordが格納されてる箇所' = md5('使用したいパスワード') where id = 'ID名';
これでログインできる。
2DB関連のクエリの書き方
1.テーブルの作成
create table db名.table名 (id int,name varchar(254));
2.テーブルのデータ挿入
insert into table名(id,name)
values (3,"Kate");
3.テーブルのデータ型の確認
show columns from table名
4.テーブルの中身の確認
select * from table名
5.テーブルへのAuto_incrementの追加
alter table table名 add primary key (id);
alter table table名 change id id int(11) auto_increment;