Q:

Inserting multiple image names either with separated commas or to make image table separate

I am having product table with product id(PK), product name, category name, product price, brand, image and category table having columns category id and name from category table. I am adding category wise product as well as only one image to the product table. I want to insert (at least 5) images in the image column for each product.
 If in future I want to add subcategory for product, what is better either to make separate table of image and then add them to that table or to insert the image with separated commas in image column of same product table. 
How do I implement it ? What is the code for that?
Valuable help will be appreciated...
Here, I'm sharing my code:add_prodcut.php
            if(isset($_POST['save_product']))    
            {
            extract($_POST);
            $target = "images/products/";
            $target = $target . basename($_FILES['file']['name']);
            move_uploaded_file($_FILES['file']['tmp_name'], $target);

              $add_product = mysql_query("INSERT INTO  `tbl_product` (`product_name` ,`category_id`   ,`product_price` ,`product_brand` , `image`) VALUES ('".$product_name."','".$category_id."','".$product_price."', '".$product_brand."', '".$_FILES['file']['name']."')");
             if (mysql_affected_rows($con) > 0)
             {
                 $_SESSION["msg"] = "Product Added Successfully"; 
             }
            }
            ?>

            <html>
            <head>..//scripts</head>
            <body>
            <form  method="post" action="">
            <?php $category = mysql_query("select * from tbl_category ");
             $lists = array();
            while($category_list = mysql_fetch_assoc($category))
            {
             $lists[] = $category_list;
            }

           ?>
            <select name="category_id" >
            <option value="">Select Category</option>
            <?php foreach ($lists as $categories) { ?>
             <option value="<?php echo $categories['category_id']; ?> "><?php echo      $categories['category_name']; ?></option>
            <?php } ?>
            </select>
            <input  name="product_name" type="text">
            <input  name="product_price" type="text">
            <input  name="product_brand" type="text">
            <input  name="file" type="file">
            <button name="save_product">Save</button>
            </form>
             </body>
            </html>

A:

When using a relational database you should never insert serialized data into cells.  It's a violation of First Normal Form.  It will in the long term cause you a world of pain.  Trust me, I've had enough experience fixing up the mess that inevitably gets left behind by this kind of design to know what a bad idea it is.  
What you should do instead is create a dependant table that has a foreign key back into the primary table.  This is the correct way to represent a 1-n relationship in a RDBMS.  
Here's some example psuedo-code for creating the tables (NOTE: This is not valid MySQL, just a fairly general SQL-like psudeo-code.  For proper syntax, see the MySQL manual).  
CREATE TABLE products (
    SERIAL product_id,
    // ...
) PRIMARY KEY product_id;

CREATE TABLE product_images (
    SERIAL image_id,
    INT product_id,
    // ...
) PRIMARY KEY image_id
FOREIGN KEY product_id REFERENCES products.product_id

I'll leave inserting and querying these tables as an exercise for the OP, but it should be fairly straightforward.  
Inserting can be done by populating the images product_id field with the ID of the product to which the image belongs.  
Getting the images is a simple matter of selecting from images based on product ID, or even joining the two tables together on the foreign key.  

