Menu

#600 I can't save new entry in mysql database

open
nobody
1
2014-09-10
2014-09-08
No

Hi

I'm trying to add an entry in the system but I can not make it save in mysql database.

example

$ select_options ['entry.producto'] = array ('e' => 'Test'
                                           'l' => 'Live Demo'
                                           'm' => 'Demo on track',
                                           'v' => 'Video'
                                           's' => 'Session');

How I can view it in "view_entry.php" and send it by mail?

Discussion

  • Campbell Morrison

    Silly question, but is the 'producto' field appearing on the edit_entry form? If not it sounds like you haven't created the field in the entry and repeat tables.

    Which version of MRBS are you running? There was a bug to do with associative arrays for custom fields in 1.4.10, so I'd upgrade to 1.4.11 if you're not running it already.

     
  • Anonymous

    Anonymous - 2014-09-09

    I create this in "edit_entry":


    function create_field_entry_producto($disabled=FALSE)
    {
    global $producto, $datalist_options, $is_mandatory_field;

    echo "

    \n";

    // 'mandatory' is there to prevent null input (pattern doesn't seem to be triggered until
    // there is something there).
    $params = array('label' => get_vocab("producto") . ":",
    'name' => 'producto',
    'field' => 'entry.producto',
    'value' => $producto,
    'pattern' => REGEX_TEXT_POS,
    'disabled' => $disabled,
    'mandatory' => isset($is_mandatory_field['entry.producto']) && $is_mandatory_field['entry.producto']);

    generate_input($params);

    echo "

    \n";
    }


    And


    case 'producto':
    create_field_entry_producto();
    break;


    And I Have 1.4.10. Actually I don't know how upgrade mrbs

    ¡Thanks!

     
  • Campbell Morrison

    You don't need to make any changes to edit_entry.php. All you need to do is to create a varchar field in the entry table called 'producto' and another in the repeat table.

    To upgrade to 1.4.11 you should:

    • backup your database
    • upload the contents of the 1.4.11 (except for the config file) to your webserver, overwriting your 1.4.10 files
    • run MRBS (if a database upgrade is needed you will be prompted for your database username and password)

    Campbell

     
  • Campbell Morrison

    Thanks. You will need to upgrade to MRBS 1.4.11 for this to work.