Help with UPDATE datetime

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
parinho7
Forum Newbie
Posts: 1
Joined: Fri Jan 31, 2014 5:09 pm

Help with UPDATE datetime

Post by parinho7 »

I want to execute an UPDATE query to update a datetime field but I am not getting the desired results!

Here is the query:

Code: Select all

$result = mysqli_query($con, "UPDATE `tasks` SET `deadline`=".$_POST['dt'].", `status_id`=3 WHERE `task_id`=".$_POST['id']."");
The deadline is the datetime field and I am POSTING the dt from a text input. Please help me. Thanks in advance!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Help with UPDATE datetime

Post by Celauran »

What does $_POST['dt'] contain? What is the expected result? What's happening instead?
Post Reply