php - Unable to insert any record and returns error:MySQL returned an empty result set (i.e. zero rows) -


if(isset($_post['submitted'])) {    //mysql_connect('localhost','root','')or die(mysql_error());    //mysql_select_db('ecommerce');    include_once ('mysql_connect.php');    if(is_uploaded_file($_files['image']['tmp_name']))    {       // $image=$_files['image']['tmp_name'];        if(move_uploaded_file($_files['image']['tmp_name'], "uploads/".$_files['image']['name']))        {           if(!empty($_post['description']))           {               $d=$_post['description'];           }           else           {              $d=null;           }           $query="insert uploads(file_name,file_size,file_type,description)values('{$_files['image']['name']}',{$_files['image']['size']},'{$_files['image']['type']}',$d)"                 or die(mysql_error());           mysql_query($query);        }    } } 

**there's no error in database connection.the picture saved inside folder no data inserted in mysql. kindly assist..your appreciated!

maybe

$query="insert uploads(file_name,file_size,file_type,description)values('".$_files['image']['name']."',".$_files['image']['size'].",'".$_files['image']['type']."','".$d."')"; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -