move sql into model
Merge branch 'thy' into dev
Merge branch 'dev' of github.com:JYWa/teamstyle16 into dev

Conflicts:
	application/views/forum/thread.php
merge thy