diff --git a/htdocs/core/modules/ticketsup/mod_ticketsup_simple.php b/htdocs/core/modules/ticketsup/mod_ticketsup_simple.php index 25fabb12377..f0293f78d1f 100644 --- a/htdocs/core/modules/ticketsup/mod_ticketsup_simple.php +++ b/htdocs/core/modules/ticketsup/mod_ticketsup_simple.php @@ -73,7 +73,8 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup $posindice = 8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM " . $posindice . ") AS SIGNED)) as max"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup"; - $sql .= " WHERE ref LIKE '" . $this->prefix . "____-%'"; + $search = $this->prefix . "____-%"; + $sql .= " WHERE ref LIKE '" . $search ."'"; $sql .= " AND entity = " . $conf->entity; $resql = $db->query($sql); if ($resql) { @@ -107,7 +108,8 @@ class mod_ticketsup_simple extends ModeleNumRefTicketsup $posindice = 8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM " . $posindice . ") AS SIGNED)) as max"; $sql .= " FROM " . MAIN_DB_PREFIX . "ticketsup"; - $sql .= " WHERE ref like '" . $this->prefix . "____-%'"; + $search = $this->prefix . "____-%"; + $sql .= " WHERE ref LIKE '" . $search ."'"; $sql .= " AND entity = " . $conf->entity; $resql = $db->query($sql);