updated mysql functions to mysqli .. note they are untested yet