diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 57bd8d0e8d3..e6334496b8c 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -257,6 +257,7 @@ if ($account > 0) if ($result) { _print_lines($db, $sql, $acct); + $db->free($result); } @@ -409,6 +410,6 @@ function _print_lines($db,$sql,$acct) $i++; } - $db->free(); + } ?> diff --git a/htdocs/compta/export/liste.php b/htdocs/compta/export/liste.php index 24a17114478..b5d3e4f28a7 100644 --- a/htdocs/compta/export/liste.php +++ b/htdocs/compta/export/liste.php @@ -69,15 +69,16 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $ $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; - print_barre_liste("Exports", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); + print"\n\n"; - print ''; + print '
'; print ''; - print_liste_field_titre("Réf","liste.php","ec.ref"); + print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref"); print ''; @@ -89,7 +90,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $var=!$var; print ""; @@ -100,11 +101,11 @@ if ($result) $i++; } print "
Client facturé
"; - $db->free(); + $db->free($result); } else { - print $db->error() . ' ' . $sql; + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 7e5df3c917a..575ae9fec73 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -165,7 +165,7 @@ if ($_GET["facid"] > 0) $result_sql = $db->query($sql); if ($result_sql) { - $num = $db->num_rows(); + $num = $db->num_rows($result_sql); } @@ -184,7 +184,7 @@ if ($_GET["facid"] > 0) /* * Prélèvement */ - print ''; + print '
'; print ''; print ''; @@ -201,7 +201,7 @@ if ($_GET["facid"] > 0) while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result_sql); $var=!$var; print ""; @@ -218,7 +218,7 @@ if ($_GET["facid"] > 0) $i++; } - $db->free(); + $db->free($result_sql); } else { @@ -239,12 +239,12 @@ if ($_GET["facid"] > 0) $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $var=!$var; print ""; @@ -265,7 +265,7 @@ if ($_GET["facid"] > 0) $i++; } - $db->free(); + $db->free($result); } else { diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index a53304068d1..427e5df21bc 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -217,7 +217,7 @@ if ($_GET["action"] == 'create') $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; while ($i < $num) { @@ -249,9 +249,10 @@ if ($_GET["action"] == 'create') // $sql .= " AND f.fk_statut = 1"; // Statut=0 => non validée, Statut=2 => annulée // $sql .= " GROUP BY f.facnumber"; // -// if ($db->query($sql)) +// $result=$db->query($sql); +// if ($result) // { -// $num = $db->num_rows(); +// $num = $db->num_rows($result); // // if ($num > 0) // { @@ -273,7 +274,7 @@ if ($_GET["action"] == 'create') while ($i < $num) { - //$objp = $db->fetch_object($i); + //$objp = $db->fetch_object($result); $objp = $charge; $var=!$var; diff --git a/htdocs/compta/param/comptes/fiche.php b/htdocs/compta/param/comptes/fiche.php index 7ddb9d9cf34..27788497f99 100644 --- a/htdocs/compta/param/comptes/fiche.php +++ b/htdocs/compta/param/comptes/fiche.php @@ -205,15 +205,16 @@ else $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product = ".$product->id; $sql .= " ORDER BY lower(s.nom)"; - if ( $db->query($sql) ) + $result=$db->query($sql); + if ($result) { - $num_fournisseur = $db->num_rows(); + $num_fournisseur = $db->num_rows($result); $i = 0; print '
Date demande
'; $var=True; while ($i < $num_fournisseur) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print ''; @@ -223,7 +224,7 @@ else $i++; } print '
'.$objp->nom.'
'; - $db->free(); + $db->free($result); } print ''; @@ -309,13 +310,14 @@ else $sql = "SELECT s.idp, s.nom, s.ville FROM ".MAIN_DB_PREFIX."societe as s WHERE s.fournisseur=1"; $sql .= " ORDER BY lower(s.nom)"; - if ($db->query($sql)) + $result=$db->query($sql); + if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); print '