Added getEvents function modify select function

now we can load events from our db!
Select had to be modified to handle multi dimensional arrays. hope this
dosnt break anything!