using mysql resource to make the data