Wednesday, May 13, 2009

mysql order by numbering 1-40

saiya: SELECT * FROM event ORDER BY eventno
saiya: tapi dia kuar tak ikut turutan number... eventno tu ade no 1 sampai 40
saiya: dia kuar 1, 11, 12, .... 2, 20, 21, 22.... 3,30,31..
saiya: camner nak ikut aturan bebetul 1 sampai 40
mazwan: eventno <-- kena dataype INT dalam mysql saiya: ha'ah laa... pandainyer ko... skarang ni type dia varchar(255) Ok.. skarang ni mcmana pulak nak tukar kan dia.. ada 2 cara. mcm biasa nak senang masuk jer kat web phpMyAdmin, carik la table kat situ dan ubah saje... satu lagi cara dlm mysql pulak..

ALTER TABLE event
MODIFY eventno INT(5);


mudah kan..


ALTER TABLE table_name
MODIFY column INT(5);

No comments: