This question already has an answer here:
<?php
$slug = $_GET['artist'];
//Connection details
$con=mysql_connect("localhost","username","password","mydatabase");
// Check connection
if (!$con) {echo "Failed to connect to MySQL"; exit; };
$result = mysql_query("SELECT * FROM band WHERE slug ='.$slug.'",$con);
$row = mysql_fetch_array($result);
echo $row[1].'<br>';
echo $row[2].'<br>';
echo $row[3].'<br>';
echo $row[4].'<br>';
?>
I cannot for the life of me figure out why there's a problem with the fetching of the array. Just as a FYI, the $_GET request is to grab the artist variable in the url of another webpage, and then what I wished was to pass that variable through MYSQL as a query, to fetch the record that has the same data held in $artist as it is in the slug attribute of band table.
</div>