laserlight to the rescue once again! Thanks 🙂
I changed my select box code to this:
// Fill Select Menu With Artists
$select_artist = "";
while ($row = mysql_fetch_array($result))
{
$select_artist .= "<option value=\"".$row['artist']."\">".$row['artist']."</option>";
}
and the script the form is submit to like this: (removed addslashes)
// Retrieve artist name from another page via $_POST
$artist = $_POST['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 now outputs:
Could not find any CD's by kev\'s! Please add a CD using the form below.
Is this somthing to with magic_quotes? Why is it adding the back slash?