Dear all,
I have written a script to create new files on my site, populated with a basic template. I have an SQL database that stores the field " $artist " as the same as the file name created, i.e. www.mysite.com/$artist.php.
I was wondering if it is possible to write into the basic template a way of dragging down the main part of the file/URL name to use as the $artist field in the script, whilst also removing the “.php” bit. i.e.
$query="SELECT * FROM table WHERE artist=‘www.mysite.com/ ‘$artist’ .php’ ";
so that the page now viewed only has data about that particular artist and not just the whole of the contents of the $artist column on display.
Perhaps there is another/better way to do this though. I’m not keen on using id’s as there are several entries under the same $artist name, but would be willing to try if you see fit.
Thanks in advance,
Matt