Tried to create a proper sql script for codeigniter