Schlo_50 Posted May 1, 2007 Share Posted May 1, 2007 I need to make my script stop adding blank events into my database by making the script start once the submit12 button is pressed. Can someone please help finish this off for me please? <?php if (isset($_POST['Submit12'])) //this bit here please!!! $self=$_SERVER['PHP_SELF']; $dat=$_POST['dat']; $month=$_POST['month']; $event=$_POST['message']; $sql = "INSERT INTO calendar ( dat, month, message ) VALUES ( '$dat','$month','$event' )"; $rd = mysql_query( $sql, $conn ); ?> Thanks! Link to comment https://forums.phpfreaks.com/topic/49494-help-with-ghosting-mysql/ Share on other sites More sharing options...
Barand Posted May 1, 2007 Share Posted May 1, 2007 Use {..} . At the moment, all code, except the first statement following the if(), is executed every time <?php if (isset($_POST['Submit12'])) { $self=$_SERVER['PHP_SELF']; $dat=$_POST['dat']; $month=$_POST['month']; $event=$_POST['message']; $sql = "INSERT INTO calendar ( dat, month, message ) VALUES ( '$dat','$month','$event' )"; $rd = mysql_query( $sql, $conn ); } ?> Link to comment https://forums.phpfreaks.com/topic/49494-help-with-ghosting-mysql/#findComment-242616 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.