Hi,
I have a form field named "artist" that posts the value "kev's" to the script below:
// 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 ".stripslashes($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);
The above outputs a form that is then submited to this script:
// Asign variables from form page via $_POST
$artist = $_POST['artist'];
$sql = "SELECT * FROM `users` WHERE `artist` = '$artist'";
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
//If no nothing is found in the DB display error
if (mysql_num_rows($result) == 0) {
echo "$report_error<h4 align=center>".stripslashes($artist)." there is a problem please contact the webmaster and quote this ref number</h4>";
exit;
}
I'm getting an error at: if (mysql_num_rows($result) == 0)
The error displays the value arist as "kev\" even though I've used stripslahses.
Sugestions much apreciated