Fixed result handling

Fixed the result handling as the old way only worked for mysql not mysqli