Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Allowing null values in a dropdown field

phpMyEdit General     Allowing null values in a dropdown field
Odoslať novú tému   Odpovedať na tému    
 
billsaysthis     Založený: 20.05.2004   Príspevky: 5  
Príspevok Zaslal: 2004-06-09 21:46
Návrat hore  Odpovedať s citátom     

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     Založený: 27.08.2003   Príspevky: 2  
Príspevok Zaslal: 2004-06-10 09:04
Návrat hore  Odpovedať s citátom     

I think you can try this:

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

should work.

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov