Update lib.php

A get_record_sql() did not work on MS SQL-Server. I hope that the fixed line works on all SQL Servers.