TGWSE_GY Posted September 22, 2009 Share Posted September 22, 2009 okay here is my code <?php $dbhost = "mysql.hmtotc.com"; $dbuser = "thegayestever"; $dbpass = "emit098nice054"; $dbname = "innonmainnj"; $tblrooms = "rooms"; $tbllocations = "directions"; $tblhome = "home"; $tblaccommodations = "accommodations"; $tblreservations = "reservations"; $tblrestaurant = "restaurant"; mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $indentity = $_POST['indentity']; if($indentity == "accommodations"){ $description = addslashes($_POST['accommodations']); $query = "UPDATE accommodations SET description='$description' WHERE id= '1'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=3"); }elseif($indentity=="home"){ $content = addslashes($_POST['content']); $promotitle = addslashes($_POST['promotitle']); $promo = addslashes($_POST['promo']); $address1 = addslashes($_POST['address1']); $address2 = addslashes($_POST['address2']); $phone = addslashes($_POST['phone']); $query = "UPDATE `home` SET content='$content', promotitle='$promotitle', promo='$promo', address1='$address1', address2='$address2', phone='$phone' WHERE id= '1'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=1"); }elseif($indentity=="locations"){<br /> $north = addslashes($_POST['north']); $south = addslashes($_POST['south']); $west = addslashes($_POST['west']); $query = "UPDATE `directions` SET north='$north', south='$south', west='$west WHERE id='1'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=3"); }elseif($indentity=="reservations"){ $content = addslashes($_POST['description']); $phone1 = addslashes($_POST['phone1']); $phone2 = addslashes($_POST['phone2']); $email = addslashes($_POST['email']); $specialtitle = addslashes($_POST['specialtitle']); $special = addslashes($_POST['special']); $query = "UPDATE `reservations` SET content='$content', phone1='$phone1', phone2='$phone2', email='$email', specialtitle='$specialtitle', special='$special' WHERE id='1'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=4"); }elseif($indentity=="restaurant"){ $dinner = addslashes($_POST['dinner']); $lunch = addslashes($_POST['lunch']); $brunch = addslashes($_POST['brunch']); $query = "UPDATE `restaurant` SET dinner='$dinner', lunch='$lunch', brunch='$brunch' WHERE id='1'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=5"); }elseif(is_numeric($identity)){ $description = $_POST['description']; $cost = $_POST['cost']; $query = "UPDATE `rooms` SET description='$description' cost='$cost' WHERE roomnumber='$identity'"; mysql_query($query) or die(mysql_error()); header("Location: http://www.innonmainmanasquan.com/admin/index.php?section=$identity"); } ?> whats happening is that it is not updating the fields, however it is taking symbols like ' that already exist in the table-collumn and changing it to a ? any ideas? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/175163-solved-update-not-working-properly/ Share on other sites More sharing options...
Calver Posted September 23, 2009 Share Posted September 23, 2009 Hello, I don't know if I can be much help, but I spotted a missing ' in the "locations" section ... west='$west Quote Link to comment https://forums.phpfreaks.com/topic/175163-solved-update-not-working-properly/#findComment-923441 Share on other sites More sharing options...
TGWSE_GY Posted October 13, 2009 Author Share Posted October 13, 2009 Thanks that was it LOL Quote Link to comment https://forums.phpfreaks.com/topic/175163-solved-update-not-working-properly/#findComment-936442 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.