Multiple save on upload plus save on database errors
<p>I have set of questions have you ever encounter some issues when multiple save on database?my problem is this, i have a database called "album" where fields are 'album_id,album_title,album_user'.</p>

<p>The html output would be there is a login section where there is a input type file where you want to add more and once you have uploaded it. and array of set of names will be stored and that array will be our que to save the file on the multiple format the problem is that. it says and error on the database whichs is sql specified twice.Do you have an idea on how to save in multiple using php?</p>

<p>code will be like this.</p>

<pre><code>    &lt;?php
class Album extends olib{

    function __construct(){
        parent::olib();
    }       

    function upload_submit() {
        $allow = array("jpg","png","gif");
        $directory = "upload";
        $pictures = array();
        $counter = 0;
        $error = '';
        if($this-&gt;jpost('upload')) {
            for($getupload = 0;$getupload&lt;count($_FILES['uploadpictures']['name']);$getupload++){           
                $extension = end(explode(".",$_FILES['uploadpictures']['name'][$getupload]));
                if(in_array(strtolower($extension),$allow)){
                    if(move_uploaded_file($_FILES['uploadpictures']['tmp_name'][$getupload],$directory."/".$_FILES['uploadpictures']['name'][$getupload])){
                        $pictures[$getupload] = $_FILES['uploadpictures']['name'][$getupload];
                        $counter++;
                    //  $this-&gt;save_user_album($_FILES['uploadpictures']['name'][$getupload],$this-&gt;setSession('user_id'));
                    }else{
                        $error[$getupload] = "Sorry seems some of the data invalid";
                    }
                }else{
                    $error = '1';
                }
            }       
            print_r($pictures);
            print_r($error);
            foreach($pictures as $urpics){
                $this-&gt;save_user_album($urpics,$this-&gt;setSession('user_id'));
            }
        }
    }


    function save_user_album($albumtitle,$session){
        $_firewall = ($this-&gt;setSession('user_id') !=="") ? $this-&gt;setSession('user_id') : "";  
            $this-&gt;jfields('album_pics_title',$albumtitle);
        //  $this-&gt;jfields('album_pics_user',$session);
        return $this-&gt;jSave('album_pics');
    }




}
</code></pre>

<p>any response will greatly appreciated!!</p>
