working version. basic functionality using mysql tables done.