hopbop Posted June 8, 2012 Share Posted June 8, 2012 So did the error checking nothing comes back as error it's connecting fine the POST info is being stored correctly in the verbals and the sql array is all in correct order and spelling is right ....... why is not it saving to DB. I have a feeling it's something silly that I am missing hence why I am posting it I need some fresh eyes on this. <?php $ecs = 'James'; if (isset($_POST['agency_contacts'])) $agency_contacts = $_POST['agency_contacts']; else $agency_contacts = 'N/A'; if (isset($_POST['newsletters'])) $newsletters = $_POST['newsletters']; else $newsletters = 0; if (isset($_POST['flyers'])) $flyers = $_POST['flyers']; else $flyers = 0; if (isset($_POST['brochures'])) $brochures = $_POST['brochures']; else $brochures = 0; if (isset($_POST['posters'])) $posters = $_POST['posters']; else $posters = 0; if (isset($_POST['high_educaiton_fair'])) $high_educaiton_fair = $_POST['high_educaiton_fair']; else $high_educaiton_fair = 0; if (isset($_POST['website'])) $website = $_POST['website']; else $website = 0; if (isset($_POST['public_service_announcements'])) $public_service_announcements = $_POST['public_service_announcements']; else $public_service_announcements = 0; if (isset($_POST['press_releases'])) $press_releases = $_POST['press_releases']; else $press_releases = 0; if (isset($_POST['special_presentations'])) $special_presentations = $_POST['special_presentations']; else $special_presentations = 0; if (isset($_POST['Inservices'])) $Inservices = $_POST['Inservices']; else $Inservices = 0; if (isset($_POST['other'])) $other = $_POST['other']; else $other = NULL; $host = "localhost"; $user = "root"; $pass = ""; $db_name = "learn_sym"; $con = mysql_connect("$host","$user","$pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($db_name, $con); $sql = "INSERT INTO outreach (id, dte, ecs, agency_contacts, newsletters, flyers, brochures, posters, high_educaiton_fair, website, public_service_announcements, press_releases, special_presentations, Inservices, other) VALUES (NULL, now(), '$ecs','$agency_contacts','$newsletters','$flyers','$brochures','$posters','$high_educaiton_fair','$website','$public_service_announcements','$press_releases','$special_presentations','$Inservices', '$other')"; if (isset($sql,$con)) { header("Location: market.php"); } else { die('Error: ' . mysql_error()); } mysql_close(); ?> Link to comment https://forums.phpfreaks.com/topic/263855-ok-simpole-insert-into-but-not-submitting-to-db-why/ Share on other sites More sharing options...
Pikachu2000 Posted June 8, 2012 Share Posted June 8, 2012 I don't see where the query is ever actually executed. Link to comment https://forums.phpfreaks.com/topic/263855-ok-simpole-insert-into-but-not-submitting-to-db-why/#findComment-1352136 Share on other sites More sharing options...
hopbop Posted June 8, 2012 Author Share Posted June 8, 2012 I don't see where the query is ever actually executed. Yup I see the prob now and thank you for pointing out the thing I was missing Link to comment https://forums.phpfreaks.com/topic/263855-ok-simpole-insert-into-but-not-submitting-to-db-why/#findComment-1352137 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.