PHP Code:
$_POST['userID'][$i]
these posted items are not arrays, and posted data are initially strings. So $_POST['userID'][0] will return the first character of the string '93'.
PHP Code:
if (isset($_POST['userID']) && is_numeric($_POST['userID'])) {
$userid = intval($_POST['userid'], 10);
}
but you need to resolve why you are expecting arrays from the posted data.
BTW It only returns one row because the glryID string of '1' doesn't have a second character to retrieve.