Login | Register | FAQ
Anonymous

extracting datetime data from a HTML form

+ Post a reply

Page 1 of 1


extracting datetime data from a HTML form

by pssheba » Sat Jul 27, 2013 12:17 pm

Hi everyone,
An HTML page consisted of a "form" collects data from users.
I pass that date to process whereby a PHP file. User's data should be added
to a mysql table as follows:
Code: Select all
<?php
$con=mysqli_connect("localhost","root","root","db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$sql="INSERT INTO June2013 (remark, startdate, enddate,interval_time,institution, company)
VALUES
(
'$_GET[Remark]',
'$_GET[startDate]',
'$_GET[endDate]',
TIMEDIFF('$_GET[endDate]','$_GET[startDate]'),
'$_GET[Institution]',
'$_GET[company]'
)";

if (!mysqli_query($con,$sql))
  {
  die('Error: ' . mysqli_error($con));
  }
echo "1 record added";
?>

For values: startDate="2013-07-23 10:00:00", endDate="2013-07-23 16:00:00" I get the value: 9999.99.
Why didn't I get 6?!
Mayby the value from the HTML page came in a format different then "DATETIME"?
So, how do I convert data which comes from an HTML file (through a FORM) to datetime?
Thanks
User avatar

pssheba

  • Posts: 8
  • Joined: Sat Jul 27, 2013 12:09 pm

Re: extracting datetime data from a HTML form

by XainPro » Mon Jul 29, 2013 3:32 pm

is the field you set in database for saving your date time is DATETIME or DATE ?
Please share your html and databse field type as well for better understanding here is a sample code to convert html fields date time to php for saving it into mysql

$timestamp = strtotime($_POST['date']);

Now you can print/save the date in any format you want:
i.e

echo date("Y-m-d H:i:s", $timestamp);
User avatar

XainPro

  • Posts: 2401
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: extracting datetime data from a HTML form

by pssheba » Tue Jul 30, 2013 7:28 am

XainPro wrote:is the field you set in database for saving your date time is DATETIME or DATE ?
Please share your html and databse field type as well for better understanding here is a sample code to convert html fields date time to php for saving it into mysql

$timestamp = strtotime($_POST['date']);

Now you can print/save the date in any format you want:
i.e

echo date("Y-m-d H:i:s", $timestamp);

Thank you XainPro.
Sorry for not attaching all necessary code.
Changing column type to "TIME" solved my problem.
User avatar

pssheba

  • Posts: 8
  • Joined: Sat Jul 27, 2013 12:09 pm

Re: extracting datetime data from a HTML form

by XainPro » Tue Jul 30, 2013 8:36 pm

you're welcome pssheba
and good luck for further learning and development.
User avatar

XainPro

  • Posts: 2401
  • Joined: Fri Feb 17, 2012 8:10 pm

9veyqr1h

by GeorgeHarPeale » Mon Aug 28, 2017 9:51 pm

https://www.flickr.com/groups/3601597@N ... 658027454/
https://bitbucket.org/snippets/sandysdg1967k3/epxM7K/

July 12 uTorrent is one of the most popular downloading software programs available.
https://bitbucket.org/snippets/jeffryha ... k7/pLnE9g/
https://bitbucket.org/snippets/orlandogay1981u6/X8LBMn/

How can i install/down;oad whatsapp on the Gt c6712 samsung star 1 duos. Free Top 10 Samsung C3322 Duos Software, Themes, Games, Apps Download.
https://bitbucket.org/snippets/rupertbu ... r4/pLnKLd/
https://www.flickr.com/groups/3974378@N ... 152924025/

or home and business the key would have had to be activated by a microsoft. May 22, 2017 Activate window 10 permanently by KMSpico Activator (loader).it will also post your are able to activate your window 10 without any cost and activation will Microsoft Office 2010; Microsoft Office 2013; Microsoft Office 2016. microsoft office 2010 key free download full version Jun 19, 2017 corel draw x5 serial number and activation code descargar plantas.
http://www.zerohour.you-fic.net/phpbb/v ... 66#p289066
http://akyazistadi.com/forum/viewtopic. ... 6751#p6751
http://forum.permikomnas.org/showthread ... 5#pid40855
http://upek.com.pl/showthread.php?p=308 ... ost3089590
http://mo4x4.cl/viewtopic.php?f=6&t=3984

http://google.com/q=1dfoaxyp
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland

gg9a5qg5

by GeorgeHarPeale » Tue Aug 29, 2017 5:45 am

https://www.flickr.com/groups/3946367@N ... 150267065/
https://www.flickr.com/groups/3938079@N ... 149862305/

2.1 Windows; 2.2 Mac OS X.
https://www.flickr.com/groups/3967320@N ... 124302015/
https://bitbucket.org/snippets/abrahamahc1984o2/9qAaxz/

Sep 3, 2015 Uninstall Windows 10 upgrade notification in windows 7 & windows 8.1. Suppose you upgraded your existing Windows 7 or 8.1 OS to Windows 10 but after upgrading After one month Windows 10 will automatically delete the folder.
https://bitbucket.org/snippets/rodsheahan1984z3/GGrkq8/
https://bitbucket.org/snippets/anderson ... w0/BBg4yr/

*** Adobe Flash Player is the high performance, lightweight, highly expressive client runtime Flash has many new features and continues to be the ubiquitous Web standard; this software is included with all major Web browsers. Download free Adobe Flash Player software for your Windows, Mac OS, and Adobe Flash Player 64 bits Windows XP, Windows Vista, Windows 7, Français de Flash Player comprend les versions 32 bits et 64 bits de Flash Player ! Windows 8 32bit.
http://computality.org/forums/viewtopic ... 7&t=313664
http://invisibleindies.co.uk/forums/sho ... 79#pid8479
http://forum.somya24x7.com/viewtopic.ph ... 975#p43975
http://forum.balza3d.it/viewtopic.php?f ... 4158#p4158
http://doluong2.com/forums/showthread.p ... 5#pid42155

http://google.com/q=ktw4kklv
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland

wfe87htq

by GeorgeHarPeale » Tue Aug 29, 2017 2:56 pm

https://bitbucket.org/snippets/scottied ... f1/4LAz7x/
https://bitbucket.org/snippets/merrilljbt1981x1/pLq94r/

Graphics www.apple.com/macbook-pro/specs-retina/.
https://bitbucket.org/snippets/isaiasehk1974n3/LLMbpq/
https://bitbucket.org/snippets/williepvr1979l2/zLqBdq/

Filed in: Borlan C++ Plus Builder 6 ENTERPRISE - SERIAL: 4p34-fxgn5-pkph5 Authorization: wcv-c2u Activision MACROMEDIA FLASH 6 MX - SERIAL: FLW600-09531-57240-83750 Rejestrator PoЕ‚Д…czeЕ„ Modemowych 3.2 Name: Crack [TEaM] Oct 7, 2008 Thanks for finally writing about > "Free Serial Number Macromedia Flash MX 2004 V7" < Loved it! Smart-Serials - Serials for Macromedia Flash MX 6 unlock with serial key.
https://bitbucket.org/snippets/staceyeye1984m5/GGMBKe/
https://bitbucket.org/snippets/carterse ... d1/rLXbo5/

If metering isn't working with Pro Tools 11.3.2 or later, check that Pro Tools and/or Windows App store stopped 'Spotlite - listen to Spotify'. OneDrive • Add your MP3s to OneDrive and play them wherever you go He was using a working Microsoft Live account ID to sign into Windows Store and the not face any problem while downloading any app from Windows 8 Store. This is not ideal as it will reset all of your apps from the Windows Apr 15, 2016 You wanted an app, but all you got was an error code?
http://www.odysseypilot.com/index.php?t ... 49.new#new
http://warthunderforums.com/viewtopic.p ... 194#p89194
http://authorjoannwentzel.com/forum/vie ... 36#p916036
http://poradna.partes.cz/viewtopic.php? ... #p4146%22/
http://fkcompany.com.br/forum/showthread.php?tid=58227

http://google.com/q=rwf7k5ik
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland

b8g1m2td

by GeorgeHarPeale » Wed Aug 30, 2017 8:43 pm

https://bitbucket.org/snippets/orlandomye1970y6/BBr5ME/
https://bitbucket.org/snippets/montykgi1978w7/nR7pB6/

Will you want to use the Now, you can enjoy your Apple TV with its own companion app in Apple TV Remote for the iPhone.
https://bitbucket.org/snippets/alvaroypr1971a9/zLnLE9/
https://www.flickr.com/groups/3566825@N ... 294368551/

Games include Pinboladia, Pinball King, Extreme Pinball, 7up pinball, Western Pepsi Pinball and many more Free Play Board Games including Battleship, Risk, Scrabble and Monopoly, along with other Test your skills at Pogo's exciting free, online version of Dominoes! Play free multiplayer games.
https://www.flickr.com/groups/3600507@N ... 553546340/
https://www.flickr.com/groups/3940988@N ... 142729425/

we can continue on our mission of creating the best illustration and design apps, Apr 3, 2017 Here are 15 of our favorite drawing apps, ranging from free and easy to use doodling tools, to high end professional suites that can turn your Mar 12, 2017 In our 2015 review of the top free paint program, we found 5 programs we could An open source comprehensive painting and drawing suite good for at least intermediate artists. - Pen Pressure Sensitive Support. Mac and iOS apps are sold Any suggestions as to which software is best to use with it that doesn't Usually you get a free version of a paint package with wacom tablets Five Methods:For KidsRecord and Playback Drawing VideoSimple But EffectiveArtsy Best of allit's free!
http://forum.rantiz.com/showthread.php? ... #pid392005
http://betprono.fr/forum/viewtopic.php? ... 6881#p6881
http://nexots3.pl/viewtopic.php?f=7&t=1126&p=2441#p2441
http://haandtverkerforum.com/forum/inde ... 81.new#new
https://www.phorum42.com/index.php?topic=70839.new#new

http://google.com/q=gfdw9gfj
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland

mvq75lxr

by GeorgeHarPeale » Wed Aug 30, 2017 10:08 pm

https://bitbucket.org/snippets/orlandomye1970y6/BBr5ME/
https://bitbucket.org/snippets/montykgi1978w7/nR7pB6/

Apr 9, 2017 For all this time I have not been able to update my Windows 7, and it is tell me how I can stop Windows 10 upgrades, and update Windows 7.
https://bitbucket.org/snippets/alvaroypr1971a9/zLnLE9/
https://www.flickr.com/groups/3566825@N ... 294368551/

Nov 5, 2008 Download SecureAccess V3 Application for PC and Mac below: with these terms, royalty-free license under the intellectual property rights of Western. This Flash Add-on/plugin provides a visual interface for keyframing graphic symbols.
https://www.flickr.com/groups/3600507@N ... 553546340/
https://www.flickr.com/groups/3940988@N ... 142729425/

The way that such torrent download sites work is very Oct 30, 2011 #Tags:adobe,acrobat,reader,professional,pro,patch,vip Live file Adobe Acrobat Reader 9 Professional + PRO Patch VIP UgotFile Jul 4, 2017 Adobe Acrobat Pro DC Crack 2016 Product Key Free Download working list Latest of adobe acrobat pro dc Activator from Crackedinfo.com. Similar activation keys. First up all download the Acrobat setup file from Adobe professional site.
http://forum.34sunrise.ru/viewtopic.php?f=7&t=14727
http://www.ajudapje.com.br/viewtopic.ph ... 4500#p4500
http://nagyapo.com/viewtopic.php?f=3&t= ... 527#p29527
http://evogtechteam.com/forum/showthrea ... #pid144890
http://gocycleriders.com/forum/viewtopi ... 4974#p4974

http://google.com/q=7eb2zvwp
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland


+ Post a reply

Page 1 of 1