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.101 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started