Hi - I have not used PHP Methods before and have a blank application that will have numerous sql queries and a fair amount of html on it.
I would to put some of the queries as php methods (to keep the page less cluttered and manageable) and call the results back into the “on execute” event section.
My question is how to i return the query results back from the method?
Thanks in advance.
Andy
Here is an example of one of the queries, with variables picking up the results.
sc_lookup(ds,“SELECT ROUND(AVG (benchmarks.accs_online),1),
ROUND(AVG(benchmarks.accs_store),1),
ROUND(AVG(benchmarks.orders_online),1),
ROUND(AVG(benchmarks.orders_store),1),
ROUND(AVG(benchmarks.udrives_online),1),
ROUND(AVG(benchmarks.udrives_store),1),
ROUND(AVG(benchmarks.conv_accs),1),
ROUND(AVG(benchmarks.conv_udrives),1),
ROUND(AVG(benchmarks.pen_fin),1),
ROUND(AVG(benchmarks.pen_px),1),
ROUND(AVG(benchmarks.pen_px_conq),1)
FROM benchmarks”);
$bmOA = {ds[0][0]};
$bmSA = {ds[0][1]};
$bmOO = {ds[0][2]};
$bmSO = {ds[0][3]};
$bmOYD = {ds[0][4]};
$bmSYD = {ds[0][5]};
$bmACon = {ds[0][6]};
$bmYDCon = {ds[0][7]};
$bmFinP = {ds[0][8]};
$bmPX = {ds[0][9]};
$bmPXConq = {ds[0][10]};