|
Posted by Dave Nash on 01/11/07 13:30
On Thu, 11 Jan 2007 13:25:30 +0000, Geoff Berrow
<blthecat@ckdog.co.uk> wrote:
>Message-ID: <q5dcq21626a1qlnps69fi1uo63mfin6mot@4ax.com> from Dave Nash
>contained the following:
>
>>>$query="UPDATE categories SET catname='$ud_catname',
>>>image='".$_FILES['ud_image']['name']."', parentid='$parentid' WHERE
>>>catid='$ud_catid'";
>>>
>>>should work.
>>
>>ive tried this code and the following comes up... And it also clears
>>the exisitng variable in the 'image" fields of the db.
>
>This is progress! :-) It means that variable is probably empty. It
>shouldn't be.
>>
>>send-out1.jpgstring(13) "send-out1.jpg" array(0) { } UPDATE categories
>>SET catname='No Parent Category', image='', parentid='43' WHERE
>>catid='44'
>Check you have out put in the $_FILES array by outputting it to screen
>
>e.g.
>print_r($_FILES);
>
>also check you have set the form correctly
>
><FORM ENCTYPE="multipart/form-data" method="post" action="<wherever your
>processing script lives>")
ive made the changes and this is the following. Very close I think ;-)
Array ( [ud_image] => Array ( [name] => send-out1.jpg [type] =>
image/jpeg [tmp_name] => C:\WINDOWS\TEMP\php1D4.tmp [error] => 0
[size] => 182419 ) ) UPDATE categories SET catname='Hockey Sticks',
image='', parentid='43' WHERE catid='43'
My script is as follows.
$query="UPDATE categories SET catname='$ud_catname',
image='".$_FILES['image']['name']."', parentid='$parentid' WHERE
catid='$ud_catid'";
@mysql_select_db($database) or die( "Couldn't execute query: " .
mysql_error());
mysql_query($query);
print_r($_FILES);
Navigation:
[Reply to this message]
|