i need var in where

i need var in where

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2
edited December 2014 in Editor

I am getting a variable in php , but I can not use it to define where.

include( "../extensions/Editor-1.3.3/php/DataTables.php" );

$var2=$_POST['ID_CAMPO'];

use
    DataTables\Editor,
    DataTables\Editor\Field,
    DataTables\Editor\Format,
    DataTables\Editor\Join,
    DataTables\Editor\Validate;

$editor = Editor::inst( $db, 'ING_VALOR_CAMPO' )
    ->pkey('ID')
    ->fields(           
        field::inst( 'ID'),
        Field::inst( 'ID_CAMPO'),
        Field::inst( 'ID_ASEGURADORA'),
        Field::inst( 'VAL_CAMPO') ->validator('Validate::required'),
        Field::inst( 'DESC_VALOR') ->validator('Validate::required'),
        Field::inst( 'SECUENCIA') ->validator('Validate::required')     
             )
    ->where( 'ID_CAMPO', $var2 )       
    ->process($_POST)
    ->json();

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Looks like it should work okay to me. What aspect of it doesn't work? Are you sending ID_CAMPO on the data request? If you could link to the page that would be very useful.

    Allan

  • rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

    ALREADY I MET

This discussion has been closed.