On Thu, 06 Apr 2006 10:04:45 +0200 Paul POULAIN <paul.poulain@free.fr> wrote:
Pierrick LE GALL a écrit :
[...] What is the official coding guideline concerning SQL queries? Can we use such specific statements?
You're right we should not. I'm the main responsible of this error, I beg your pardon !
OK, so I'll replace this query. As it is possible to add more than one stopword on a single form submission, I would first have thought to do something like: "DELETE FROM stopwords WHERE word IN ('word1','word2',...)" and after a single insert statement : "INSERT INTO stopwords (word) VALUES ('word1'), ('word2'),..." But this is not possible if we want to use the variable binding (ie '?' in queries). So we have to make as many inserts as line to insert :-/ On this example, that's not a problem because you never submit many stopwords at a time, but I suppose somewhere in Koha we insert many lines at a time... Is there an official guideline about that?
That's the main reason why we say we are mySQL compliant only for instance. Hopefully, "replace" should be only found in /admin/ directory. They was the 1st scripts I did for Koha & in Perl, when starting to be involved in Koha, in 2002,january. I agree they are really poor (Perl as well as mySQL. But they work correctly...)
They work (nearly) correctly (on HEAD, prev/next buttons do not work) but I'm working on this page. It's not an important page, but it make me work on Koha code to learn how pages are build. You'll ask me to revert if you feel my modifications are irrelevant. Cheers :-) -- Pierrick LE GALL INEO media system