Fix: le substr doit partir de la fin de la chaine
This commit is contained in:
parent
c1453953c6
commit
b4f236a54c
@ -398,7 +398,7 @@ function info()
|
||||
if (eregi('^'.$searchLastWithNoYear.'',$comyy))
|
||||
{
|
||||
// Recherche rapide car restreint par un like sur champ indexé
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,$posindice))";
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '${comyy}%'";
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -437,7 +437,7 @@ function info()
|
||||
if (eregi('^'.$searchLastWithNoYear.'',$fayy))
|
||||
{
|
||||
// Recherche rapide car restreint par un like sur champ indexé
|
||||
$sql = "SELECT MAX(0+SUBSTRING(facnumber,$posindice))";
|
||||
$sql = "SELECT MAX(0+SUBSTRING(facnumber,-".$posindice."))";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber like '${fayy}%'";
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -398,7 +398,7 @@ function info()
|
||||
if (eregi('^'.$searchLastWithNoYear.'',$pryy))
|
||||
{
|
||||
// Recherche rapide car restreint par un like sur champ indexé
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,$posindice))";
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " WHERE ref like '${pryy}%'";
|
||||
$resql=$db->query($sql);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user