I get the following error

FATAL: emalloc(): Unable to allocate 1073741824 bytes

when I try to read a record from an MS SQL
database with more than 21 fields in the record. I've tried to release memory, and read the rest of the fields with a second query. I'm using the following code to read the data.
$query2="SELECT DOMAINNAME, AnnualSales, Employees, Notes, Webad, Specials, CustomerID, WebLinkStorage
FROM Customers WHERE CustomerID = $company_id";

if (!$conn) {
echo "Database Connection Error!<BR>If this problem persists please contact the Webmaster.";

$result=odbc_exec($conn, $query2);