I am trying to enter new information into a database everytime a user clicks a submit button in my form. It works perfectly but it only works one time. So it will enter one row into the database and after that if the user fill out the form again and clicks submit no information will be entered into the database until i delete the previous row so it works if the database is empty. Here is my code to enter it into the database if you need more info to help let me know i will rate u up and everything thanks in advance
if($_POST['submit']){
$query = mysql_query("SELECT * FROM chanels WHERE cname = '$cname'");
$numrows = mysql_num_rows($query);
if($numrows == 1) {
echo "You Channel has already been added. Go back your <a
href='./memberpage.php'>Station Page.</a>";
}else{
if($_POST['description']){
$description = $_POST['description'];
if(strlen($description) < 250 ){
$code = $_GET['code'];
$category = $_POST['category'];
mysql_query("INSERT INTO chanels VALUES
('','$code','$cname','$category','$description',''
)");
echo "You Channel has been added. Go back your <a
href='./memberpage.php'>Station Page.</a>";
}else
echo "Your description must be less than 250 characters!";
}else
echo "You must enter a description!";
}
}