You actually only need Dali's first example, as the BLOB field will be
NULL anyway if it doesn't exist. if it exists and is empty, it won't
add much to the result either...
I would replace the if with
if (!empty($row['blob'])) {
//do something
}
but that's just a matter of taste I guess.
On 3/11/2008, at 11:03 PM, Michael wrote:
On Mon, 03 Nov 2008 23:01:34 Dalibor Andzakovic wrote:
> SELECT * FROM table1 LEFT JOIN table2 ON (table1.productid =
> table2.productid) WHERE table1.productid = '$id'
>
> Will get all the records from table1 and matching fileds from table
> 2. Then
> in you php code you can do
>
> While($row = mysqli_fetch_assoc()){
> If(sizeof($row['blob'] > 0){
> // do something with blob
> }
> }
>
> HTH
>
> Dali
Thanks, however is it possible to find out what we need to know about
the blob
field (Does it exist and have content?) without actually 'select'ing
it and
thus introducing it in to the result set?
I am wondering if this will give optimised performance.
Michael.
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---