I'm very new to the MySQL world so I'm sorry if this might be something obvious!
What I'm trying to do is a Query that outputs price data on different pages, at the moment it works fine - however on each page i use the query I have to change the productpage name in the query. How can I automatically get the filename of the page (excluding .PHP) and insert that name into the query? (I have a corresponding column in the DB with all the different page names)
$query=("SELECT *
FROM database e
JOIN validdate1 r ON e.datevalid1=r.id
JOIN validdate2 d ON e.datevalid2=d.id
WHERE productpage='page01'
ORDER BY price2,
So rather than manually entering page01, i want it to be fetched from the file name (in this case is page01.php).
Thank you in advance!