Jump to content

Default value to insert into MySQL


Jaguar

Recommended Posts

What should I insert as the default value if a form field is blank? My fields don't currently accept null.

 

if($_POST['height']) {
  // error checking
  $height = $_POST['height'];
}
else {
  $height = '';
}

 

Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?

Link to comment
https://forums.phpfreaks.com/topic/56408-default-value-to-insert-into-mysql/
Share on other sites

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.