Jump to content

[SOLVED] Insert problems ..going blind looking for problem


CodeMama

Recommended Posts

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

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); ?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.