Use the following to implement the image upload and image display code. These
steps must be done in order
- Open the
command line interface.
Download the script and run
it in the command window with the command "SOURCE C:\newCatalog.txt".
(This assumes that you saved the script file in the root folder of drive
C. If not, make any necessary adjustments in the path name.)
- The script creates the database 'catalog' and the table 'products'.
- This script creates the database but DOES NOT populate
it. You take care of that via productUpload.htm in a later step.
Download the html and php files used to upload and display images.
- The files should be stored in the root folder of your web server. This will be
called something like www, htdocs, or similar.
- Don't forget to change the password in each of the php files.
Use productUpload.htm to load the product information
for the first four products stored in
- This is the step that actually populates the database.
- Be sure that you use the URL 'http://localhost/productUpload.htm'.
- If the files are in the 'saveAndRetrieveImages' folder then use the URL
- Use 'productDisplay.htm' to display the selected product
Once you get the sample code running, copy the code and modify it to store
images in MySQL as path/filenames rather than as blobs.
Provide txt versions of all php files.