RE: [PHP] SQLqry in PHP

From: Date: Thu, 30 Jan 2003 14:07:19 +0000
Subject: RE: [PHP] SQLqry in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-133642@lists.php.net to get a copy of this message
Hi, > Yes, the field in the mssql database is > 1073741824, > but i want only to grab a few byte. I think you'll need to do this in the database, then. If you try and grab the whole field and then parse it in your script, you have to actually get that gig of data into your script - I assume this is where the error is happening, as your server doesn't have enough memory to store the query results. > Here is my code: > $sql = "SELECT tblSamNr.Body FROM tblSamNr where ID like '$id'"; Can you do select a substring with MSSQL? Something like: SELECT SUBSTR(tblSamNr.Body, 500, 2048) (assuming the 2kb text you want to grab starts at character 500) Cheers Jon

« previous php.general (#133642) next »