unable to upload image using MOVE_UPLOADED_FILE
<p>i am trying to upload image using loop but didnt find any success in this everything is working fine in the code except move_uploaded_file function it always echo no i used same code else and working fine in uploading but not here please help me to find bug what i am doing wrong here</p>

<pre><code>if(!empty($_POST['sc_num']))
    {
        $sc_num= $_POST['sc_num'];
    for($i=1;$i&lt;=$sc_num;$i++)
    {
        $sctitle = $_POST['sctitle_'.$i];
    $scfile=  $_FILES['scfile_'.$i]['name'];
        switch($_FILES["scfile_".$i]['type'])
        {
            case 'image/jpeg': $ext = 'jpg'; break;
        case 'image/gif': $ext = 'gif'; break;
        case 'image/png': $ext = 'png'; break;
        case 'image/tiff': $ext = 'tif'; break;
        default:$ext = '';break;
        }
        if ($ext)
        {
            $sc="/screenshots/".$t.'.'.$ext;
        if(move_uploaded_file($_FILES['scfile_'.$i]['tmp_name'],$sc))
                    echo "image uploaded success";
                    else
                    echo "unable to upload image";
        }

        $query="insert into screenshots values('".$company_id."','".$sctitle."','".$sc."')";
            $result= mysql_query($query) or die("unable to perform query3"); 
            }
        }
</code></pre>

<p>is there any way by which i could echo php error in using move_uploded_files function instead of echoing custom no  </p>
