Jump to content

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


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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.