Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Custom code After Save

Post Reply
sultan87
Posts: 32
Joined: Wed Jun 10, 2015 10:28 pm

Custom code After Save

Unread post 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
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Custom code After Save

Unread post by admin »

sultan87,

I don't understand your question.

Steven
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: Custom code After Save

Unread post 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.
Post Reply