Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    UK
    Posts
    22

    Simple file management, php, mysql

    Hi,

    I am trying to building a simple file admin utility for a customer for their car contract hire listings.

    I am very new to php/mysql so a 'dummies' guide would help.

    I have already created a table with fields:
    make, model, co2, monthly amount.. and would like include another field for an image where:

    For each record that the customer creates or amends I would like to allow the customer to be able to select from a dropdown menu list of images and choose the appropriate car image relating to that record that will show on the web page when viewed by visitors. I will have already created and uploaded these images to a pre-defined directory for them to choose froom


    Your help is very much appreciated


    Neil

  2. #2
    Join Date
    Mar 2004
    Location
    Los Angeles
    Posts
    617
    I am not sure if i understand it right away, please clear me if i have not understood your question.

    following code should gather image names from the table and make it listed in a html drop down menu.

    Code:
    <?
    $sql = mysql_query("SELECT image from TABLE_NAME");
    // these will gather field name "image" from table_name in
    // an array
    ?>
    <select name="menu">
    <?
    while ($row = mysql_fetch_array($sql)) {
    echo "
    <option>$row</option> // for every element in array to be listed.
    ";
    ?>

  3. #3
    Join Date
    Mar 2004
    Location
    Los Angeles
    Posts
    617
    You have to close the while tag after the statement.
    I could not edit the post.

    Like:

    while {
    ..
    }

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    22
    What I need to do is select an image from a directory and then when selected save the image to the table for image to be shown on the web site when visitors view the listings.


    Here is a mock up of what how I want it to work:


    This is the what the visitor will see, and i would also like a image to show for each vehicle at the beginning of the row
    http://www.netmotivated.co.uk/projects/mysql/index.php

    this is the admin interface:
    http://www.netmotivated.co.uk/projects/mysql/admin.php

    Here I would like a function to my customer to view a list of images available (which as I said before, I will have already uploaded to a specific directory) and select which one they wish to use for that record. Please note: I have not updated the fields with the correct names an error will occur but you will will see wwhat i am trying to do.


    Am I making sense?

    Neil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •