postCreate query
postCreate query
KeepMoving
Posts: 28Questions: 7Answers: 0
Hi Im trying to do a select in a 'postCreate' function
how can I do that?
Im doing something like:
->on( 'postCreate', function ( $editor, $id, $values, $row ) {
$editor->db()
->query('select', 'mytable')
->where('IdUsuario', 39)
->exec();
} )
but Im getting syntax error,
This discussion has been closed.
Answers
I don't see a syntax error there. Could you show me the whole PHP file and also the error statement please?
Allan
Actually what I want to do is a select email from usuario where laboratorio = "the lab row I've created"
Then store the value in a variable and send an email.. notification
I've read this https://editor.datatables.net/docs/1.5.1/php/source-class-DataTables.Database.html#228-250 topic and now the select is working (I think..)
Now I want to store de value and send the email..
Okay good - so that
select
appears to be working now? You could use aquery('insert')
if you want to write information to another table, and also PHP's ownmail
method to send an email.Allan
Just a question allan,
how can I see the content of $data variable?
I have this.. but..
Im getting an empty {}
$notif
is aResult
class instance. You would need to use$notif->fetchAll()
or$notif->fetch()
to get the row.Allan
Hi Allan,
thank you for your time and answers
I been searching a lot and now Im getting the correct results in query()
the problem is when I try to send the email says "Notice: Undefined index: email"
Here is the function
When I send the email with the result of $res wich is correct.
Then:
The
notif
array is empty, so it is correct to tell you that there is no such index.I think you mean
$rows['email']
(note I would suggest you rename$rows
to be$row
to avoid confusion in the future).Allan