null form variables???

admin

Administrator
Staff member
I have a form with various fields. If all aren't filled out, how can I get it to add NULL to the mysql db. Right now it must be entering a space or something because if I do a (Select * from NAME Where SOMETHING IS NOT NULL) it show everything including the black fields.

Form is currently: (example input)

<td width=50 class="sans">First:</td><td><input type="Text" name="first_name" value=http://www.phpbuilder.com/board/archive/index.php/"<?php echo $first_name?>" size="30">

processing page:

<?php

$db = mysql_pconnect("pittweb");

mysql_select_db("mylan");


$sql = "INSERT INTO members (first_name,last_name,address,company,faxlist,city,state,
zip,k,q,conference,calendar,christmas,pocketcal,email,phone,fax) VALUES
('$first_name','$last_name','$address','$company','$faxlist','$city','$state',
'$zip','$k','$q','$conference','$calendar','$christmas','$pocketcal','$email',
'$phone','$fax')";

$result = mysql_query($sql);

?>

ty
 
Back
Top