php - Update field with result of DateDiff of two other populated fields -


all need take 2 datetime fields , set third field result.

this has easy i've been working on 2 days , cannot result i'm looking for.

$con = mysqli_connect(dbhost, dbuser, dbpass, dbname) or die('connection failed: ' . mysqli_connect_error());  $helpme=mysqli_query($con, "update chat_main set exact_time = datediff(start_timestamp, end_timestamp)");  mysqli_close($con); 

the issue datediff returns number of days between 2 dates. appears in context of implementation, 2 dates on same day. so, 0 result of datediff. suggest using timediff, difference of 2 times, not 2 dates.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -