Announcement

Collapse
No announcement yet.

[SOLVED] insert with button (calculated fields are empty )

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] insert with button (calculated fields are empty )

    Hi , I try to do a update in a grid with a button for recording in an external table.
    I do not get to have all the fields in my insert. Those in the sql table are the cons by those calculated in the grid are empty .
    The sql is correct but calculated fields
    *' HEB ' = > "' { HEB }' "
    *****' DEP ' = > "' { DEP }' "
    *' CARE ' = > "' { CARE }' "
    ****' C114 ' = > "' { P114 }' "
    ' C116 ' => " 0" "
    ****'TOTAL' = > "' { TOTAL }' "




    $ base = mysql_connect ( 'localhost' , 'root' ,'') ;
    mysql_select_db (' a6cav ', $ base) ;
    $ insert_table = ' indem_prov ' / / Table name
    $ insert_fields = array ( / / Field list , add as many as needed
    *****'num' => " 'NULL' "
    *****' ETAB ' => "[ etab ] '"
    *****'SECT ' => "[ section ] " ,
    *****' MAT ' = > "' { MAT }' "
    *****'NAME' = > "' { NAME }' "
    *****'YEAR' => " '2013 '"
    'CAT ' = > "' { } CATBP '"
    *****' HEB ' = > "' { HEB }' "
    *****' DEP ' = > "' { DEP }' "
    *' CARE ' = > "' { CARE }' "
    ****' C114 ' = > "' { P114 }' "
    ' C116 ' => " 0" "
    ****'TOTAL' = > "' { TOTAL }' "
    *) ;

    / / Insert record
    $ insert_sql = ' INSERT INTO a6cav.indem_prov ('. implode ( ',', array_keys ($ insert_fields ) ). ') '
    ****. ' VALUES (' implode ( ',', array_values ​​($ insert_fields ) ) . . ') ;
    mysql_query ($ insert_sql ) or die (' SQL error ! ' $ insert_sql '<br />' mysql_error (). . . )

  • #2
    resolu

    Yes I solved only in the php code Button must return the complete code for the event on record.
    I thought departing the value calculated fields was back in post see get ... in short anything!
    So in the button should reset the code of the event!

    resolute

    Comment

    Working...
    X