Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Allowing null values in a dropdown field

phpMyEdit General     Allowing null values in a dropdown field
Post new topic   Reply to topic    
 
billsaysthis     Joined: 20 May 2004   Posts: 5  
Post Posted: 2004-06-09 21:46
Back to top  Reply with quote     

If I use the values[] option to set up the input as a dropdown list linked to a table, there is no way I can see to specify the value as NULL even if the field is defined to allow nulls in the database. Can anyone suggest a way to handle this? The field as I have now is:

$opts['fdd']['ParentID'] = array(
'name' => 'Parent ID',
'select' => 'T',
'maxlen' => 11,
'default' => '0',
'values'=>array('table'=>'products', 'column'=>'ProductID', 'description'=>'PartNumber'),
'sort' => true
);

 
daniele     Joined: 27 Aug 2003   Posts: 2  
Post Posted: 2004-06-10 09:04
Back to top  Reply with quote     

I think you can try this:

$opts['fdd']['ParentID']['values2'] = array(''=>'');
$opts['fdd']['ParentID']['sqlw'] = 'if(\'$val\' = \'\',NULL,\'$val\')';

should work.

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy