Thanks so much again,
I am just plain getting frustrated here. For some reason I am still having trouble. Here is my code right now.
function prepIn($input) {
$input = trim($input);
if (!get_magic_quotes_gpc()) {
return addslashes($input);
}
return $input;
}
$bandName = prepIn($_POST['bandName']);
$sql = "UPDATE band_page SET bandName='$bandName', location='$location' WHERE bandid = '$userid'";
$result = mysql_query($sql, $conn) or die(mysql_error());
If I enter a band name like Tom's Band, and then go into phpmyadmin it displays it as Tom's band. Then on another page I have this code:
function prepOut($input) {
$input = stripslashes($input);
return htmlspecialchars($input);
$getbname = "SELECT bandName, bandid from $table WHERE bandid = '$userid'";
$result1 = mysql_query($getbname, $conn) or die(mysql_error());
$row2 = mysql_fetch_assoc($result1);
$bandName = prepOut($row2['bandName']);
}
{
at this point if i end that with exit($bandName) , it says Tom's Band.
but right after it I have this code:
$sql = "INSERT INTO $table2 SET stitle='$stitle', bandName='$bandName', bandid = '$userid'
and am getting a fatal mysql error that says check for the syntax to use near " 's Band bandid = '5' ?
Does this mean that its going into the DB wrong? Should it be in the db with slashes at this point? Does that mean that magic quotes is on?
Sorry guys,..sooooo confused.
😕 😕