protected function prepareTable(&$table)
{
$table->location = NULL;
}
2. But this is not enough as Viet Vu mentioned, since by default NULLS are not updated. So if you want Joomla to always update fields which values are NULL, edit file administrator/components/com_basketball/tables/game.php and override method store() like this:
function store($updateNulls) {
return parent::store(true);
}
protected function prepareTable(&$table)
{
if(!$table-> location) $table-> location = NULL;
}
so that it is saved as NULL only when the field is empty.