i am unable to store data in database

<?php

include ("db_connect.php");

$res = mysql_query("SELECT * FROM posts");
while($data = mysql_fetch_array($res))
  {
  $pid=$data['pid'];
  }
echo $pid; 

$pid=$pid+1;

//Get data in local variable
$ptitle=$_POST['ptitle'];

$uname=$_POST['uname'];

$email=$_POST['email'];

$pcont=$_POST['pcont'];

if ($uname==""  or $ptitle=="" or $pcont=="" or $email=="")

echo "All fields must be entered, hit back button and re-enter information";

else{

$query="insert into posts (pid,ptitle,pcont,uname,email) values('$pid','$ptitle','$pcont','$uname''$email')";

mysql_query($query)  or die(mysql_error());

echo "Your Experience have been recorded";

}

?>

Its throughing error " Column count doesn't match value count at row 1 "

Some1 please help e its urgent

missing a comma

$query="insert into posts (pid,ptitle,pcont,uname,email) values('$pid','$ptitle','$pcont','$uname''$email')";

should be

$query="insert into posts (pid,ptitle,pcont,uname,email) values('$pid','$ptitle','$pcont','$uname','$email')";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.