0

The setting

Windows 11

Server-Version: 8.4.0 - MySQL Community Server - GPL Apache/2.4.61 (Win64) PHP/8.3.8

Ubuntu

Server-Version: 10.3.39-MariaDB-0ubuntu0.20.04.2 - Ubuntu 20.04 Apache/2.4.41 (Ubuntu) PHP-Version: 8.3.8

In phpmyadmin this sql

SELECT * FROM `search` WHERE  colname='verlag' and match(what) against( 'O\'reilly' in boolean mode);

delivers results on the Windows system and on Ubuntu allthoug teh DB-system is different.

But my web aplication on Ubuntu delivers results (>0) but in Windows none (==0)

The PHP source on both system is the same as well as the database. The collation for column what is utf8mb4_german2_ci on both systems.

$this->param->search="O'Reilly";
$this->param->colname="verlag";

$q = "select titleid as id from search where colname=? and match(what) against(? in boolean mode) ";
$ttt = $connect_pdo->prepare($q);
$ttt->execute([$this->param->colname, $this->against($this->param->search)]);

Do I have a PHP problem ?

8
  • One way you can test is to turn on the general log while running both queries, then check it to see what exactly was passed in, and compare the two. Make sure to turn the general log back off when you're done, as it will fill up fast.
    – aynber
    Commented Jul 8 at 13:05
  • Turned generl log on and got On Windows select titleid as id from search where colname='verlag' and match(what) against(' +O\'Reilly' in boolean mode) on Ubuntu select titleid as id from search where colname='verlag' and match(what) against(' +O\'Reilly' in boolean mode)
    – Heinz
    Commented Jul 8 at 13:36
  • It looks to be exactly the same, so I don't think it's a PDO/PHP issue.
    – aynber
    Commented Jul 8 at 13:40
  • Just to be sure - phpMyAdmin still giving you results, when you insert that space and + from your query logs, into the query you are testing in pma as well? Talking about against(' +O\'Reilly' in boolean mode)
    – CBroe
    Commented Jul 8 at 13:52
  • @CBroe On Windows I get no result when using the the query with ' +' in phpmyadmin, on ubuntu I get a result. Eliminating ' +' from the pattern I get results on both systems
    – Heinz
    Commented Jul 8 at 14:50

0