Data not inserting into mysql Database in php
<p>i am trying to insert data into mysql database but all thing going fine no error occur but when i browse data so it is not inserted into database here my coding kindly check it out. </p>

<p>here my html codes:</p>

<pre><code>&lt;html&gt; &lt;head&gt;

&lt;title&gt;Insert Latest News&lt;/title&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;form action="insert_post.php" method="POST" enctype="multipart/form-data"&gt;

&lt;table align="center" border="10" width="800"&gt;

&lt;tr&gt; &lt;td align="center" colspan="5" bgcolor="yellow"&gt;&lt;h1&gt;Insert Latest News&lt;/h1&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr&gt; &lt;td&gt;Post Title&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="title" size="30" /&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr&gt; &lt;td&gt;Post Author&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="author" /&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr&gt; &lt;td&gt;Post Image&lt;/td&gt; &lt;td&gt;&lt;input type="file" name="image" /&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr&gt; &lt;td&gt;Post Content&lt;/td&gt; &lt;td&gt;&lt;textarea name="content" cols="50" rows="20"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr&gt; &lt;td colspan="5" align="center"&gt;&lt;input type="submit" name="submit" value="Publish" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;

&lt;/form&gt; &lt;/body&gt; &lt;/html&gt;
</code></pre>

<p>Here is my connection script</p>

<pre><code>$connect = mysql_connect("localhost","root",""); 
$con = mysql_select_db("express", $connect); 
if ($con){ 
    echo ""; 
} else { 
    echo "databse not connected"; 
} 
</code></pre>

<p>here my php codes:</p>

<pre><code>&lt;?php require("connect.php");

if (isset($_POST['submit'])){

    $title = $_POST['title'];
    $author = $_POST['author'];
    $content = $_POST['content'];
    $image_name = $_FILES['image']['name'];
    $image_type = $_FILES['image']['type'];
    $image_size = $_FILES['image']['size'];
    $image_tmp = $_FILES['image']['tmp_name'];
    $date = Date('y/m/d');

    if ($title=='' or $author=='' or $content=='' or $image_name==''){

        echo "&lt;script&gt;alert('Any feild is empty')&lt;/script&gt;";
        exit();
    }
    if ($image_type=='image/jpeg' or $image_type=='image/png' 
    or $image_type=='image/gif' or $image_type=='image/jpg'){

        echo "";
    } else {
        echo "&lt;script&gt;alert('your image type is not allowed')&lt;/script&gt;";
    }
    if ($image_size&lt;=1000000){
        move_uploaded_file ($image_tmp, "images/$image_name");  
        exit();
    } else {

      echo "&lt;script&gt;alert('Image is larger, not allowed by admin ')&lt;/script&gt;";
    }

    $query = "INSERT INTO news
             (news_title, news_author, news_content, news_image, news_date) 
             values($title,$author, $content, $image_name, $date,)";

    if ($query){
        echo "&lt;center&gt;&lt;h1&gt;Your News has Been Published&lt;/h1&gt;&lt;/center&gt;";
    } 
} 
?&gt;
</code></pre>