Good morning, I'm inserting a custom sql query to create a drop-down menu in the form of an add page, but even though the query is correct, when I start the page it doesn't work, it seems like it doesn't recognize the $page_id variable.
The query without $page_id filter (works correctly and returns me all records):
"SELECT DISTINCT dr.id_distinta, dr.id_fase AS value, caf.codice AS label FROM line_list dr JOIN cfg_anagrafica_fasi caf ON dr.id_fase = caf.id"
The query with $page_id filter doesn't work:
"SELECT DISTINCT dr.id_distinta, dr.id_fase AS value, caf.codice AS label FROM line_list dr JOIN cfg_anagrafica_fasi caf ON dr.id_fase = caf.id WHERE dr.id_distinta = $page_id"
I'm a new user of phprad and I've only been using it for a short time, sorry for my Google English. I have a table with the quantities ordered and the quantities made, on the list page I would like to insert a progress where for the quantities made field where the MAX value is the value I take from the quantities ordered field. I can't find any automatic mechanisms for my needs and I tried with MAX <?php echo intval($data['quantity_ordered']); ?> but it gives me an error. Thank you