View Full Version : BLOB value in WHERE cluase?
fuzzy1
04-13-2007, 02:55 AM
Hey All,
Trying to sort out a way to verify blob data has been uploaded (php)
WHERE blob_field IS NOT NULL works fine while blob_field value = [BLOB - NULL], but what about when blob_field value= [BLOB - 0 Bytes] or something less than... say -- 200k???
Fumigator
04-13-2007, 07:43 AM
I reckon char_length() works on a blob column type... if that is anything but 0 then you know you've got something in there.
fuzzy1
04-13-2007, 03:58 PM
Thanks Fumigator.
As always, it pays to post! three different forums, three different answers, and the winner is... (in context)SELECT * FROM inspections
WHERE id='$record'
AND report_pdf IS NOT NULL
AND OCTET_LENGTH(report_pdf) >= 200*1024
AND status='Closed'" ;
Submitted by: bradgrafelman (http://phpbuilder.com/board/showthread.php?p=10795980#post10795980)
Fumigator
04-13-2007, 06:51 PM
OCTET_LENGTH() is just a synonym for LENGTH(), which is almost the same as CHAR_LENGTH() :p
guelphdad
04-13-2007, 07:53 PM
Length, which is what I suggested on another forum (or maybe two).
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.