将图像添加到现有的MySql记录

I'm quite new to PHP and MYSQL.

I need to add an image to an existing record.

So I have a list of records and when I click the link directing to this page.

In this form I would like to ad an image.

Thanks in advance

I would highly discourge you from saving files in a database like that.

Here are the steps that I have used before:

  1. I would create a folder on the server for each user.
  2. Save the filename and extension in a table.
  3. Save the file to the server folder.

If I wanted to grab a file I would go to the right directory and file name.

Examples:

Profile Picture = {userFiles/userID/filename}

Contract for Billy = {userFiles/{Billy'sID}/{filename}