This topic is locked

MySQL type of SET

3/8/2005 7:11:13 PM
PHPRunner General questions
S
sgeggie author

I have a table with a field that is of type SET. This is meant to have multiple selections within the ENUM values specified.
How might this sort of multi-valued selection be made possible?

admin 3/10/2005

Hi,
you can do the following to create multi-selectable control.
Specify Edit as Lookup wizard for your SET field on the Formatting tab in PHPRunner.

Then specify Select size two or more and enter list of values in the Edit format dialog for this field.

Build the pages.

Open include\..._functions.php file with any text editor and search it for function BuildSelectControl.

In this function replace the following line

if($strSize>1 && $mode==MODE_SEARCH)

with

if($strSize>1 && $mode==MODE_SEARCH || $field=="setfield")



Do not forget to replace setfield with the actual field name.
And the following code

else

{

$ret='<select size = "'.$strSize.'" name="value'.$ifield.'">';

if($strSize<2)

with

else

{

$ret='<select size = "'.$strSize.'" name="value'.$ifield.$postfix.'"'.$multiple.'>';

if($strSize<2)



This also works for VARCHAR fields, not only SET.