I'm getting this error here
This is the code from line 71 to 93
if (!empty($_POST['catagory']) && ($_POST['catagory'] == 'new')) {
//add entry to database
$q = 'INSERT INTO catagory (cat_name, cat_desc) VALUES ($cat_name, $cat_desc)';
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 'sss',$cat_name,$cat_desc);
mysqli_stmt_execute($stmt);
//check result
if (mysqli_stmt_affected_rows($stmt) == 1){
$thankyou[] ='Catagry added to the database';
$a = mysqli_stmt_insert_id($stmt);//get catagory id
} else {
$errors[] = 'The new catagory could not be added to the database';
}
//close prepared statment
mysqli_stmt_close($stmt);
}else{
$errors[] = 'Please enter the catagory name and description';
}elseif(isset($_POST['catagory']) && ($_POST['catagory'] == 'existing') && ($_POST['existing'] > 0)){
$a = (int) $_POST['existing'];
} else {
$errors[] = 'Please enter or select a catagory.';
}I know it's something around the elseif statement, but i just cant figure out what, and i've double checked all the { and } and they seem ok, Any help?
Many Thanks, Ben
Help



















