Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

writeCreate/postCreate issue

$
0
0

Hi,

For some reason

$editor->on('writeCreate',function( $editor, $id, $values ) use ($pdo) {
            print_r($pdo->query('SELECT * FROM `table` WHERE id=:id',array('id'=>$id))->results());
});

or

$editor->on('postCreate',function( $editor, $id, $values, $row ) use ($pdo) {
            print_r($pdo->query('SELECT * FROM `table` WHERE id=:id',array('id'=>$id))->results());
});

prints me an empty array.

I would expect to get the data instead. $id, $values, $row already exist, but the data is not yet physically written into the DB. I need to run a query with a simple JOIN, which is impossible to execute because the row is still not there. What should I do?

Thanks,


Viewing all articles
Browse latest Browse all 3740