This topic is locked

field type of 'enum'

7/6/2006 6:18:22 PM
PHPRunner General questions
K
keithh0427 author

I have a table with several MySQL field types of "enum" with valid values of "Y" and "N".
I'd like to use a checkbox to indicate that. If I modify the table and set them to "1" and "0", everything is fine. Can I get PHPRunner to use "Y" and "N"?

J
Jane 7/7/2006

Hi,
open ..._fucntions.php file, find make_db_value($field,$value,$type="",$postfilename="") function, locate and modify following code snippet. See my changes in Bold:

else if(substr($type,0,8)=="checkbox")

{

if($value=="on")

$ret="y";

else if($value=="none")

return 'null';

else

$ret="n";

if(NeedQuotes($finfo["type"]))

$ret="'".$ret."'";

return $ret;

}

else

return false;