[thelist] MySQL CREATE TABLE - img file??

kristina kristina at kfx-design.co.uk
Wed May 15 02:55:07 CDT 2002

on Tuesday, May 14, 2002, 3:53:21 PM, Ben wrote:

> however, it depends on what language you are using (if it's php then i
> can probably help) and how you are uploading the image to the server.
  I am using php/mysql

> sample code (image uploaded into $image)
> ========================================
  I've tried modifying the code you wrote and its giving me problems!!
  I think due to the fact that there won't be an img uploaded
  everytime so I've enclosed the code in an if else.  Somewhat
  unsuccessfully (methinks!)


  my effort:

          // this gets the auto_increment primary key of the most recent insert
          if (($image != 'none') && ($image != '')) {
            $imageid = mysql_insert_id();

          // save image to photos directory
            $image_location =".$imageurl".$imageid.".gif";
            move_uploaded_file($image, $image_location);
          else {
            $imagefilename = $image;

  I have hashed this together from 2 different bits of code, (& as you
  can probably tell, I don't really have a clue what I'm doing!!)


kristina at kfx-design.co.uk

More information about the thelist mailing list