That was the problem, I print out $SQL to the screen and it showed the
correct SQL statement, I've tried as you suggested, but it still did not
work... see my DBI debug output below if this will help?

I checked the image path and it is definitely correct.

Any ideas?

Thanks,
Kevin

[root@server1 cgi-bin]# perl blob.cgi
    DBI::db=HASH(0x81b34a0) trace level set to 2 in DBI 1.14-nothread
    Note: perl is running without the recommended perl -w option
    -> prepare for DBD::mysql::db (DBI::db=HASH(0x81b34b8)~0x81b34a0 'UPDATE
banners SET banners.image =
LOAD_FILE('/var/www/htdocs/corporate/images/homenew.jpg') where
banners.id=1')
Setting mysql_use_result to 0
    <- prepare= DBI::st=HASH(0x8196e48) at blob.cgi line 17.
    -> trace in DBD::_::common for DBD::mysql::st
(DBI::st=HASH(0x8196e48)~0x81bcd04 2)
    <- trace= 2 at blob.cgi line 18.
    -> execute for DBD::mysql::st (DBI::st=HASH(0x8196e48)~0x81bcd04)
    -> dbd_st_execute for 081bccf8
    <- dbd_st_execute 0 rows
    <- execute= '0E0' at blob.cgi line 20.
    -> finish for DBD::mysql::st (DBI::st=HASH(0x8196e48)~0x81bcd04)
    <- finish= 1 at blob.cgi line 25.
    -> disconnect for DBD::mysql::db (DBI::db=HASH(0x81b34b8)~0x81b34a0)
imp_dbh->svsock: 8150e5c
    <- disconnect= 1 at blob.cgi line 26.
    -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x81bcd04)~INNER)
    <- DESTROY= undef during global destruction.
    -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x81b34a0)~INNER)
    <- DESTROY= undef during global destruction.


----- Original Message -----
From: "Gerald Clark" <[EMAIL PROTECTED]>
To: "Kevin Smith" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 01, 2002 5:32 PM
Subject: Re: LOAD_FILE over SMB filesystems


> The single quotes around $image prevent perl from substituting the value.
> You are trying to load a file named $imageFN.
> $SQL = "UPDATE banners SET image=load_file(\"$imageFN\") where id=1";
>
> Kevin Smith wrote:
>
> >After reading some other posts on inserting a image into a blob field, I
> >tried using DBI to insert and the following does not work...
> >
> >I've double-checked the path and it is correct.
> >
> >$imageFN = '/var/www/htdocs/corporate/images/homenew.jpg';
> >$SQL = "UPDATE banners SET image=load_file('$imageFN') where id=1";
> >
> >If I execute the same SQL statement at the MySQL > prompt it inserts into
> >the database fine... what am I doing wrong?
> >
> >Thanks,
> >
> >Kevin
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >Before posting, please check:
> >   http://www.mysql.com/manual.php   (the manual)
> >   http://lists.mysql.com/           (the list archive)
> >
> >To request this thread, e-mail <[EMAIL PROTECTED]>
> >To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
>
>
>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to