Hello everyone - I have been referencing this forum for a long time for help with my code and I decided to register today after being super-stumped with this snipet of code that works generally, but if the value "tip" from the database has a slashed apostrophe, it is not working. The echo tags were there to verify the values of all the variables, and with fields with apostrophes, everything matched up. I did not get the die error, so the script apparently thinks it did the update? But it didn't. Again, it works for all the non-slash-apostrophe'd entries - any ideas? Thanks again!
while ($row = mysql_fetch_array($result))
{
$tip = $row["tip"];
$rate = $row["rate"];
if (stripslashes($tip) == $tip2) {
if ($vote2 == "yes") {
$newrate = $rate + 1;
}
if ($vote2 == "no") {
$newrate = $rate - 1;
}
$tip2 = addslashes($tip2);
echo $tip2;
echo "<br>";
echo $newrate;
echo "<br>";
$update = "UPDATE content SET rate='$newrate' WHERE tip='$tip2'";
mysql_query($update) or die('There was a problem with your vote, please contact the administrator.');
}
}