July 19th, 2000, 02:17 AM
Here's the deal, I'm working on this site that lists alot of bands, how would i got about creating something in php so that I can make a template and just have all the content from the band sites listed in it. If you dont understand what I'm talking about(i have a hard time explaning myself) I need something that will make something like this as an outcome http://www.shoutweb.com/channels/?artist=taproot I have just started using Php/MySQL and I hope you all understand. I NEED HELP!
July 19th, 2000, 09:20 AM
Whenever you pass a variable in the url, php automatically creates it for you in the next page. so if you have the url:
you'll automatically have a variable called $artist with value "taproot"
you can do something like this:
****Page 1 - List Bands****
$result = mysql_db_query("select artist from bands_database");
while (list($artist) = mysql_fetch_row($result))
echo "<a href="page2.php?artist=$artist">$artist</a><br>n";
****Page 2 - Show Artist****
//variable $artist automatically set
$result = mysql_db_query("select artist,songs,members from bands_database where artist='$artist'");
if (list($artist,$songs,$members) = mysql_fetch_row($query))
echo "Artist = $artist<br>n";
echo "Songs = $songs<br>n";
echo "Members = $members<br>n";
echo "Artist $artist not foundn";
You'll have to establish a connection to mysql of course and check the syntax, but hopefully that gives you an idea..