Results 1 to 5 of 5

Thread: re-order update mysql

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default re-order update mysql

    im using this tutorial to make a re-arranging sql dB based on jQuery.
    http://teamtutorials.com/web-develop...ate-a-database

    my question is how would i have an upload image button to work with this type of system?
    i know what i am asking is a lot so i dont expect anyone to do the work or anything but just a conversation or maybe a point in direction on how this type of task could be achieved.

    this is part of my upload code that works well but im stuck trying to integrate the 2
    Code:
    <?
    $directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
    $uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/';
    $uploadForm = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
    $uploadSuccess = 'http://' . $_SERVER['HTTP_HOST'] . $directory_self . 'index.php';
    // name of the fieldname used for the file in the HTML form
    $fieldname = 'file';
    
    $uploadFilename = $uploadsDirectory . $_FILES[$fieldname]['name'];
    $_SESSION['fileName'] = $_FILES[$fieldname]['name'];
    
    @move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename);
    	//or error('receiving directory insuffiecient permission', $uploadForm);
    header('Location: ' . $uploadSuccess);
    ?>

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Upload an image to where? Insert the actual image data into MySQL, or an I/O file system upload?
    - Josh

  3. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    this would act as a backend cms that would look something like this
    the image would upload into a folder
    then each of those rows would have a unique image name associated with it
    so that when you re arranged the order, the dB or xml would be affected
    Last edited by ggalan; 08-30-2011 at 08:28 PM.

  4. #4
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    What does your table structure look like (if you're using one)? Best practice is to store the file name into the database when uploaded. I don't know whether you want to update an existing db row, insert a new row into the db, update an XML sheet, write a new node to an XML sheet, etc.

    Please be much more specific as to what you need.
    - Josh

  5. #5
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    i have this, which outputs a json file, but i cant seem to add the upload image button and make it work
    http://bit.ly/nT1dZx


    re: i re-uploaded this link. has the correct files now
    Last edited by ggalan; 08-30-2011 at 11:58 PM.

Bookmarks

Posting Permissions

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