problem wite Date Field

Questionsproblem wite Date Field
Georges asked 1 month ago

my master grid is:

$grid->select_command = “SELECT Droits, DateRamasse , sum(NB_PALETTES) as Qpal FROM RESULTATS GROUP BY DateRamasse “;

DateRamasse is a date

i want to pass  this date to detail:

$opt[“subgridparams”] = “Droits,DateRamasse”;

 

in detail I do:

$Ram = $_GET[“DateRamasse”];
$Droit = $_GET[“Droits”];

 

but I don’t get my date ($Ram) to prepare my detail

$grid->select_command = “SELECT * FROM RESULTATS WHERE Droits = ‘”.$userdroits.”‘ AND DateRamasse = “.$Ram;

 

where is the problem?

problem of date ?

probleme with subgridparams?

 

Thanks

 

 

 

 

 

3 Answers
Abu Ghufran Staff answered 4 weeks ago

Hi,

In query:

$grid->select_command = "SELECT * FROM RESULTATS WHERE Droits = '".$userdroits."' AND DateRamasse = '".$Ram."'";

I think, the date field needs to be enclosed in quotes.
Also open the debug console (ctrl+shift+c) and then network tab, and check if the parameters are shown correctly in the ajax call.

Share some screenshot / screen-recording if not solved.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Georges answered 3 weeks ago

Hi Abu,

I ‘ve tried with quotes too, without effect.

in MARIADB database, dates are ‘Y-m-d’  ex: 2024-11-29

I dont’ know how to be sure of date format in grids

first I wanted so display d/m/Y (french format). It was OK but maybe it was the problem

So i used format Y-m-d , but same problem  (grid displays Y/m/d)

i think that it is a problem of SQL format but I can’t solve it.

Regards

Georges

 

 

 

Abu Ghufran Staff answered 2 weeks ago

Please share your code so I can regenerate this case.

You can email me at [email protected]

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

11 + 7 =

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?