Call a stored procedure
Posted: Wed Sep 23, 2020 7:58 am
Hi there,
I'd be super grateful if someone could please help me out.
I've created a stored procedure that I want to call via a button on a from, and pass it a variable. Here's what I've done:
1. Saved a stored procedure in the mySql database called copy_all_mealplan which takes in one variable
2. Put an input field on my form with the code copy_from_unit for the variable
3. Created a procedure in nuBuilder that uses that input field and calls the stored procedure:
But it doesn't work.
Hoping someone can please point out what I've missed, or if my syntax is wrong, or if my approach is flawed...
Thanks so much.
I'd be super grateful if someone could please help me out.
I've created a stored procedure that I want to call via a button on a from, and pass it a variable. Here's what I've done:
1. Saved a stored procedure in the mySql database called copy_all_mealplan which takes in one variable
2. Put an input field on my form with the code copy_from_unit for the variable
3. Created a procedure in nuBuilder that uses that input field and calls the stored procedure:
4. And finally a button on the form which runs that nuBuilder procedure$COPYFROMUNIT = '#copy_from_unit#';
$sql1 = "call copy_all_mealplan($COPYFROMUNIT)";
query($sql1);
But it doesn't work.

Thanks so much.