Hi,
I re-typed my question! it's much more simple than Io first thought!
The script below fills a select box with all "artists" in my db:
// Fill Select Menu With Artists
$select_artist = "";
while ($row = mysql_fetch_array($result))
{
$select_artist .= "<option value='".$row['artist']."'>".$row['artist']."</option>";
}
When I select the value "kev's" and sumit the form to this sciprt:
// Retrieve artist name from another page via $_POST
$artist = addslashes($_POST['artist']);
echo "$artist";
$edit_profile_button = "<form name=\"profile\" method=\"post\" action=\"edit_profile.php\">
View/Edit $artist Profile<input type='hidden' name='artist' value='$artist'>
<input type=\"submit\" name=\"Submit\" value=\"Profile\"></form>";
$sql = "SELECT * FROM `cds` WHERE `artist` = '$artist'";
$result = mysql_query($sql);
// Report Db errors
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
// Report Nothing Found
if (mysql_num_rows($result) == 0) {
echo "Could not find any CD's by ".$artist."! Please add a CD using the form below.";
}
it out puts kev not kevs! How can I stop this happening?
Thanks