Jump to content

Trying to merge Date and Time Fields


bravo14

Recommended Posts

Hi

 

I am trying to merge to fields to make a date and time.  The date field is calculated to be 4 days from today and the time is selected from a select menu using the following code

 

<select name="end_time">
  <option value="12:00:00">12:00 Noon</option>
  <option value="17:00:00">5:00pm</option>
</select>

 

Using the following php script

 

$end_time=strtotime("H:i",$_POST['end_time']);  //Line 35
$date=date("Y-m-d");
$end_date=strtotime($date ."+4 days" );
$end_date_time=$end_date.$end_time;

$add_vehicle_sql=mysql_query("INSERT INTO `tbl_auction_lot`(`cust_id`,`reserve`,`make`,`model`,`spec`,`fuel`,`doors`,`mot_date`,`fns`,`fos`,`rns`,`ros`,`condition`,`reg_no`,`service_history`,`sale_type`,`status`,`keepers`,`gearbox`,`emissions`,`colour`,`date_first_reg`,`date_manufacture`,`bhp`,`engine_size`,`end_date`,`current_price`)
VALUES ('$seller_id','$reserve','$make','$model','$body_style','$fuel_type','$no_of_doors','$mot','$fns','$fos','$rns','$ros','$vehicle_condition','$vrm','$service_history','auction','$status','$prev_keepers','$gearbox','$emissions','$colour',$date_reg','$date_man','$bhp','$engine_size', '$end_date_time','$reserve')") or die(mysql_error());

 

I am getting the following error message

 

Notice: A non well formed numeric value encountered in /home/sites/trade-bidz.co.uk/public_html/add-vehicle.php on line 35

 

What have I done wrong?

Link to comment
Share on other sites

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.