Update explain, first part of updating diagnostics, use mysqli objects instead mysql_ calls, return the query paramters received, actual error reporting if the select statement fails, beginning of a scan implementation.