CodeMama Posted February 24, 2009 Share Posted February 24, 2009 Having problems with a very simple insert and form that was working until I added 3 new fields to the db the new fields are the StartDate, EndDate and advertiser here's code: <?php $ebits = ini_get('error_reporting'); error_reporting($ebits ^ E_NOTICE); //connect to database include 'inc/dbconnOpen.php'; //start script if(isset($_POST['add'])) { $href = $_POST['href']; $title = $_POST['title']; $blurb = $_POST['blurb']; $StartDate = $_POST['bmonth'] ."-". $_POST['bday'] ."-". $_POST['byear']; $EndDate = $_POST['emonth'] ."-". $_POST['eday'] ."-". $_POST['eyear']; $expos = $_POST['expos']; $advertiser = $_POST['advertiser']; $query = "INSERT INTO `textads` (`title`, `href`, `blurb`, `StartDate`, `EndDate`, `expos`, `advertiser`) VALUES ('".$title."', '".$href."', '".$blurb."', '".$StartDate."', '".$EndDate."', '".$expos."', '".$advertiser."' )"; echo $query; mysql_query($query) or die(mysql_error()); //handy variable view include ("VariableReveal2.php"); echo "New Dream Job Text Ad added <br> <a href='enterForm2.php'>Add New Ad</a>"; if it doesn't appear to be there it must be in the form, it gives the generic sql insert failed error every time Quote Link to comment https://forums.phpfreaks.com/topic/146742-solved-insert-problems-going-blind-looking-for-problem/ Share on other sites More sharing options...
darkfreaks Posted February 24, 2009 Share Posted February 24, 2009 im helping here but she is getting this: Notice:a non well formed numeric value encountered on line 69,70,71 <?php // lines 69-71/// $StartMonth = date("M",$adstart); $StartDay = date("d",$adstart); $StartYear = date("Y",$adstart); ?> Quote Link to comment https://forums.phpfreaks.com/topic/146742-solved-insert-problems-going-blind-looking-for-problem/#findComment-770404 Share on other sites More sharing options...
premiso Posted February 24, 2009 Share Posted February 24, 2009 Is $adstart a valid timestamp? Quote Link to comment https://forums.phpfreaks.com/topic/146742-solved-insert-problems-going-blind-looking-for-problem/#findComment-770407 Share on other sites More sharing options...
darkfreaks Posted February 24, 2009 Share Posted February 24, 2009 $adstart = mktime( 0,0,0, date("m") , date("d")+2, date("Y")); Quote Link to comment https://forums.phpfreaks.com/topic/146742-solved-insert-problems-going-blind-looking-for-problem/#findComment-770411 Share on other sites More sharing options...
CodeMama Posted February 24, 2009 Author Share Posted February 24, 2009 ok I commented out that stuff it was from something else I was trying and I doubt is keeping the insert from working since it's not being inserted to the db Quote Link to comment https://forums.phpfreaks.com/topic/146742-solved-insert-problems-going-blind-looking-for-problem/#findComment-770414 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.