From d45ababbbb25f1c9dc3f6f35f699716699451d25 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 17 Jun 2010 16:07:27 +0000 Subject: [PATCH] Dont insert blank events into the schedule --- admin/schedule.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/schedule.php b/admin/schedule.php index 7067ad0..4ac01dc 100644 --- a/admin/schedule.php +++ b/admin/schedule.php @@ -154,12 +154,12 @@ } else if($_GET['action']=="saveevent") { $id=intval($_POST['id']); - if(!$id) { - mysql_query("INSERT INTO schedule (conferences_id) VALUES ('{$conference['id']}')"); - $id=mysql_insert_id(); - } list($event_id,$event_type)=explode(":",$_POST['event_id']); if($event_id>0) { + if(!$id) { + mysql_query("INSERT INTO schedule (conferences_id) VALUES ('{$conference['id']}')"); + $id=mysql_insert_id(); + } mysql_query("UPDATE schedule SET title='".mysql_real_escape_string($_POST['title'])."', date='".mysql_real_escape_string($_POST['date'])."',