GithubHelp home page GithubHelp logo

Comments (4)

Ultraboss77 avatar Ultraboss77 commented on July 30, 2024 1

J'ai déjà tenté de faire comme ça oui, mais justement la valeur du paramètre ressort en type string, ce qui provoque une erreur de syntaxe sql !
Le seul moyen de faire propre, c'est de binder le paramètre en forçant son type.
Or c'est impossible avec le code actuel (à moins de se passer de DB::Prepare pour cette req)
C'est un vrai casse-tête ce bug !

from core.

pifou25 avatar pifou25 commented on July 30, 2024

Normalement, si on peut préparer la requête avec un paramètre à condition d'utiliser la notation :number dans le SQL :

     $values = array(
       'number' => $delete_number,
     );
     $sql = 'DELETE FROM timeline ORDER BY `datetime` ASC LIMIT :number';
     DB::Prepare($sql, $values, DB::FETCH_TYPE_ROW);

Ainsi, ça devrait remplacer :number par sa valeur...
https://www.php.net/manual/fr/pdo.prepared-statements.php

from core.

zoic21 avatar zoic21 commented on July 30, 2024

Bonjour,
Pas sur que le bug vienne de php8 a mon avis il est sur toute les plateforme. Je vais tester un fix

from core.

Ultraboss77 avatar Ultraboss77 commented on July 30, 2024

C'est le fix que j'ai actuellement sur mon jeedom et qui fonctionne.
Avant php8.0, l'erreur était silencieuse et la fonction execute finalisée. Mon historique de timeline était bien purgé (quasi sûr, sinon je l'aurais vu).

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.