I have a table in a database called Artists. It contains two bands. What I would like to do is to be able to click on the bands name using a hyper link, send that bands name to
you can't put PHP code into echo and hope that it will run again.
Try this,
echo
"<a target='Main_Frame' href='Side_Menu_ContentPrint.php?Aname=" . $row['ArtistName'] ."'>". $row['ArtistName'] . "</a>";
You need to fetch id of band, and place it into while loop to create dynamic functional links. You could use band name instead of id, but it can lead to errors. Better to do with the primary key.
$id = $row['id'];
<a target='Main_Frame' href=Side_Menu_ContentPrint.php?id=$id>" . $row['ArtistName'] . "</a>
Use this
echo "<a target='Main_Frame' href='Side_Menu_ContentPrint.php?Aname=".$_POST['ArtistName'].$row['ArtistName'] . "'</a>";
you can use http_build_query
please see http://www.php.net/http_build_query
you can c onvert a PHP Array to a Query String… and Back Again , Please see below
$myArray = array(
"car"=>array("ford", "vauxhall", "dodge"),
"animal"=>"elephant",
"language"=>"php"
);
echo http_build_query($myArray);
// Outputs: car[0]=ford&car[1]=vauxhall&car[2]=dodge&animal=elephant&language=php
$queryString = "car=ford&animal=elephant&language=php";
parse_str($queryString, $output);
print_r($output);
Array
(
[car] => ford
[animal] => elephant
[language] => php
)