hi i have a events script for users if the user submits a event then the event shows up fine but if they add another event it over rights the previous event how can i stop that where they can add more than one but maximum 4 as one time
my php process page is as follows:
$query = 'insert into events set etype = "'.$etype.'", edate = "'.$edate.'", region = "' .$region.'", pcode = "'.$pcode.'", town = "'.$town.'", title = "'.$title.'", advert ="' .$advert.'", ltm ="' .$ltm. '", user_id =' . $userid ;
//echo $query ;
$insert = mysqli_query ( $conn,$query ) or die(mysqli_error($conn)) ;
if($insert)
{
//echo "added" ;
header("location: addedmeets.php");
exit;
}
and the database table is as follows:
CREATE TABLE IF NOT EXISTS events (id int(11) NOT NULL AUTO_INCREMENT,user_id int(11) NOT NULL,etype varchar(50) NOT NULL,edate varchar(50) NOT NULL,region varchar(50) NOT NULL,pcode varchar(50) NOT NULL,town varchar(50) NOT NULL,title varchar(255) NOT NULL,advert text NOT NULL,ltm varchar(50) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
any help would be much appreciated ty x