Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1838346
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:27:56+00:00 2026-05-17T06:27:56+00:00

i am using the jQuery Plugin Uploadify to upload files, and i store the

  • 0

i am using the jQuery Plugin Uploadify to upload files, and i store the image name with path into the database with simple mysql query and then retrieve it.

my MySQL database table is using the following entities,

id int(20) 
image_url varchar(255)

my image store procedure is such as, i first rename the file, give it a unique name and move it to the desired directory. and then store the image name with path into the database.

currently by using simple mysql INSERT statement i am storing a single file name.

now i want to upload the array of image names with path. or i want to store as much image as i want dynamically into the single table col image_url, for some reason i plan to store 4 or more images, i want all the four image to have one particular id number.

how do i do it?

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:27:57+00:00Added an answer on May 17, 2026 at 6:27 am

    Edit 2
    I removed the previous scripts, here’s a new one:

    basically what i want to achieve is when inserting into the database i would like to store the image path with names as arrays. so that i could store as much images i want into a particular id, for example an id 1 will have 3 images, id 2 will have 5 images , id 3 will have 4 images and so on

    Best way to do this is to add a separate entry for each image url. You can also use a single entry and store all the urls as an array, but since you’re storing this in a database that isn’t very useful. Storing each entry separately makes it a lot easier to access and update the data.

    Also, make sure the “id” field in your table isn’t a primary key / auto incrementing. Otherwise you won’t be able to use the same id more than once. I fixed that here:

    // array with your images
    $images = array('url1','url2','url3');
    
    // determine a new id
    $sql = "SELECT MAX(id) FROM images";
    $res = mysql_query($sql);
    list($id) = mysql_fetch_row($res);
    
    // highest current id, plus one
    $id++;
    
    // now create a values array to insert in the database
    $values = array();
    
    foreach ($images as $image) {
      $values[] = "($id, '".mysql_real_escape_string($image)."')";
    }
    
    // comma-separate the values
    $values = implode(',',$values);
    
    // run the query
    $sql = "INSERT INTO images (id, image_url) VALUES $values";
    mysql_query($sql);

    If you do want to store arrays, it’s best to serialize the data and use unserialize when you retrieve it. Example:

    $images = array(...);
    
    $images = serialize($images);
    
    $sql = "INSERT INTO images (image_url) VALUES ($images)";

    To add images, you should then first retrieve the data, unserialize the array, update the array with the new images, serialize it again, update the database entry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jQuery Form plugin to upload an image. I've assigned a fade
How do you rotate an image using jQuery-rotate plugin? I have tried the following
I know they're using a jQuery plugin, but I can't seem to find which
I am wondering if anyone has any experience using a JQuery plugin that converts
Using the jQuery Validation plugin and AJAX, how can I validate the contents of
I am using the jQuery tableSorter plugin on a page. Unfortunatley, the table that
I'm using the jQuery.Validation plugin for client side validation, and among other things I
I'm using the jQuery Validation plugin and I've got a textbox with the class
I'm using the Tablesorter Jquery plugin to sort a table, but the images background
I'm using the JQuery Cycle Plugin in an attempt to fade in/out images for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.