Allow db num_rows/fetch_row to accept sql string or ref