MySQL column ID as file name

Discussion in 'PHP' started by rps111, Aug 23, 2007.

  1. #1
    Hi all.
    I am trying to build a PHP web form that feeds the data in a MySQL database. The data entered is varchar and a file is also uploaded.

    The following columns are present in the database:
    vName (not null)
    vNameID (auto increment)
    vFileName
    vDescription

    I want that the file should be stored in a folder named ./files/ and that the uploaded file should be renamed to vNameID.

    Thanks in advance.
     
    rps111, Aug 23, 2007 IP
  2. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #2
    jakomo, Aug 23, 2007 IP
  3. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #3
    Your post is confusing. You want to export from DB, or to import in DB?
     
    gibex, Aug 23, 2007 IP
  4. rps111

    rps111 Peon

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dear Friends:

    Ther exact problem is that the PHP form consists of the fileds

    Name:
    Address:
    Picture:

    The MySQL table is
    vName
    vNameID (unique, auto_increment, not_null)
    vAddress
    vPicture

    I want that the picture that is uploaded should be stored in a folder named ./files/ and the link to be stored in vPicture column.

    Further, I want that the file should be renamed as value in vNameID.

    Thanks in advance.
     
    rps111, Aug 24, 2007 IP