how to upload a file location from a php form to a varchar table in mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcare
    New Member
    • Apr 2010
    • 3

    #1

    how to upload a file location from a php form to a varchar table in mysql

    I am trying to load an image file location to a mysql table via php
    I can type the location into the form but wish to browse for the file then submit into the varchar table.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    If you have the mysql module loaded with PHP, then you can use the mysql functions to connect and update a table.


    Dan

    Comment

    • mcare
      New Member
      • Apr 2010
      • 3

      #3
      Originally posted by dlite922
      If you have the mysql module loaded with PHP, then you can use the mysql functions to connect and update a table.


      Dan
      Thanks Dan
      I am using a cms type of interface to allow administrators to run an events calendar which works well with the exception of loading an image location with the event info..hence the need to browse for the file first.
      Kind Regards
      Melvyn

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Hey.

        One thing I'm not clear on. Where exactly is the file you want inserted into the table, and what exactly do you want to be placed in the table?

        I mean:
        • Is the file on your PC, and you want it uploaded to the server and the location saved in the database. (Most commonly done.)
        • Is the file already on the server, and you just need to put the location into the database?
        • Is it on another website, and you need the URL place inside the database?
        • Is it on your PC, and you need it uploaded into the database?
        • Something else entirely?

        Comment

        • mcare
          New Member
          • Apr 2010
          • 3

          #5
          Originally posted by Atli
          Hey.

          One thing I'm not clear on. Where exactly is the file you want inserted into the table, and what exactly do you want to be placed in the table?

          I mean:
          • Is the file on your PC, and you want it uploaded to the server and the location saved in the database. (Most commonly done.)
          • Is the file already on the server, and you just need to put the location into the database?
          • Is it on another website, and you need the URL place inside the database?
          • Is it on your PC, and you need it uploaded into the database?
          • Something else entirely?
          Thanks for your reply
          the image is on the server and i want to be able to browse the images and send the url to the database . if i use an html form to browse for the image i then dont seem able to upload to the database. I am sure i am mnissing something here.

          Comment

          Working...