Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Tri sur date - Bug ou mauvais codage de ma part 10 Sep 2012 04:50 #3455

  • sarki
  • sarki's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 18
  • Thank you received: 0
Hello,
Je souhaiterai pouvoir aficher les résultats uniquement à partir du jour existant.
J'ai fais un module pour afficher des résultats dans lequel j'ai pu utiliser la condition suivante dans la requête SQL :
$query->where('publish = 1 AND startsecours > curdate() - 1 ');

Le composant faisant la requête différement, j'ai ajouté dans le fichier du dossier "models" la condition suivante :
. $this->_buildQueryWhere()
. 'WHERE startsensibi > curdate() - 1'

Cela fonctionne quand je suis connecté en Super Utilisateur, mais étonnament pas lorsque je suis simple visiteur, j'ai l'erreur suivante :
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in
Ai-je oublié qqchose ou s'agit-il d'un bug ?

Merci du retour :)
Sarki

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Re: Tri sur date - Bug ou mauvais codage de ma part 26 Sep 2012 11:49 #4017

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
J'étais pourtant certain de t'avoir répondu ....
$query->where('a.published = 1 AND a.startsecours > curdate() - 1 ');
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Re: Tri sur date - Bug ou mauvais codage de ma part 01 Oct 2012 11:27 #4186

  • sarki
  • sarki's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 18
  • Thank you received: 0
Hello Jocelyn,
Oui, tu m'avais répondu dans le sujet que j'avais créé dans la partie EN en mettant un lien sur ce sujet, c'est ok.
J'ai mis la condition dans le filtre, comme valeur par défaut, cela fonctionne comme ça ;)
Sarki

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.081 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started