If Blank Update "No Details Submitted"

Hi,

I have simple insert code and form. However I want people to be able leave some fields blank if they want to. Yet inserted into the database is “No Details Submitted”

For example if someone does not want to submit a budget they can leave the cell blank but I want to echo something to say that “No Details Submitted”

I need something like this:

    if(!isset($_POST['budget']) || empty($_POST[budget'])) {
    INSERT INTO eventjobs  = "No Details Submitted.";

    }

Can anyone advise how I should do this please?

	 <?php
	 if(isset($_POST['createevent'])){
    $organiserid = $row['id'];
	$eventlocation = $row['town'];
	$eventcountry = $row['country'];
    $eventname = mysql_real_escape_string(trim($_POST['eventname']));
	$eventdetails = mysql_real_escape_string(trim($_POST['eventdetails']));
	$supplier1 = mysql_real_escape_string(trim($_POST['supplier1']));
	$budget1 = mysql_real_escape_string(trim($_POST['budget1']));
		
		
{
        $query = mysql_query("INSERT INTO eventjobs (dateregistered, eventname, eventdetails, organiserid, eventlocation, eventcountry, supplier1, budget1) VALUES (NOW(), '" .$eventname."','" .$eventdetails."',  '" .$organiserid."', '" .$eventlocation."',  '" .$eventcountry."',   '" .$supplier1."', '" .$budget1."' ) ");
        }
}

?>





	  		<div class="registerinputcelltop">
					<div class="datainput">
					<li class="li_1" >
			  <div class="registerinputleft">	
           Event Name (Optional):
			</div>
			  <div class="registerinputright">
         <input class="field" type="text" name="eventname" type="text" width="600" value="" />
           </div>
			  </li>
				    </div>
				      </div>

A proper design would most likely go against what you want to accomplish here. If they do not submit details, then just leave it null. Now if you want to display a notice to the user to notify them of this, such as the “echo” part pf your post would imply. then you’d do something like:


if ($budget1 == null) {
echo "Record inserted, however, you did not supply any details."
}

Also, please consider using PDO in the future: http://php.net/manual/en/book.pdo.php