server side scripting : if null cannot just show nothing ' '
server side scripting : if null cannot just show nothing ' '
fc338339
Posts: 16Questions: 8Answers: 1
Field::inst( 'tablename.fieldname' )->setFormatter( 'Format::ifEmpty', '' ),
or
Field::inst( 'tablename.fieldname' )->setFormatter( 'Format::ifNull', '' ),
as result it still show 'null'
please help
This discussion has been closed.
Answers
Hi @fc338339 ,
Is this in the database, or the table on the client? Looking at the code, it should be setting the value in the database to be an empty string. One point, the manual here only has the
fieldname
, I'm not sure it needs to be prefixed bytablename.
.Hope that helps,
Cheers,
Colin
This coding is in databases at server-side-processing.php
which need to include
include( $_SERVER['DOCUMENT_ROOT']."/modules/Editor-PHP-1.5.3/php/DataTables.php" );
above two Format IS NOT what I want,
I even try below method but still show 'null'
I wish DO NOT SHOW ** 'null' or '0'**
Please do help
Thanks
You don't need a set formatter at all if you just want an empty string to be saved as an empty string (unless you are using an Oracle db or a trigger which will set empty strings to be null).
Can you have a look in your database directly (using phpMyAdmin, pgAdmin or whatever database tool you use for your db) and let me know if
null
is what is actually being stored?Allan