Jump to content

Help with ghosting mysql


Schlo_50

Recommended Posts

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

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 );
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.