Date Diff

QuestionsDate Diff
Chris Doum asked 7 years ago

Hi…
I work this to update a 3nd col named 'meres' with Deduction date_pire and date_epistrvfh, but is not work, have you any idea…

function update_client($data)
{

$selected_ids = $data["auto_id"];

$d = $data["params"];
$d["meres"] = $meres;

$meres='SELECT (TO_DAYS(date_pire)-TO_DAYS(date_epistrvfh) )as meres FROM person_ka_aposp';

mysql_query("UPDATE person_ka_aposp SET meres=$meres WHERE auto_id IN ($selected_ids)");

}

1 Answers
Abu Ghufran answered 7 years ago

You can change query to:
mysql_query("UPDATE person_ka_aposp SET meres=(TO_DAYS(date_pire)-TO_DAYS(date_epistrvfh)) WHERE auto_id IN ($selected_ids)");

Your Answer

20 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?