Page 1 of 1

Custom code After Save

PostPosted: Mon Nov 07, 2016 8:28 pm
by sultan87
hello,
the code in after-save is not performed
Code: Select all
nuDebug("Après Sauvegarde Séjours Locataires");

// Recherche id_locataire dans table suivi

nuDebug("Recherche Numéro Locataires");

$s = "

SELECT s_id_locataire
FROM suivi
WHERE id_suivi = '1'

";

$t = nuRunQuery($s);
$r = db_fetch_row($t);
$p = $r[0];

// MAJ id_locataire dans table sejours

$s = "

UPDATE sejours
SET id_locataire_sejour =  '$p'
WHERE id_sejours = '#RECORD_ID#'

";

why ?
Best regards
pierre

Re: Custom code After Save

PostPosted: Mon Nov 14, 2016 7:01 am
by admin
sultan87,

I don't understand your question.

Steven

Re: Custom code After Save

PostPosted: Thu Nov 17, 2016 2:37 pm
by mobilemcclintic
I think you need to tell nubuilder what to do.

Just reading the last bit,you set $s, but don't do anything with it.
Add nuRunQuery($s); to the end. If everything else is right, it should perform your update.