diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 4f6f2324052..5a68db3e78f 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -21,7 +21,8 @@
*
*/
-/** \file htdocs/comm/mailing/index.php
+/**
+ \file htdocs/comm/mailing/index.php
\ingroup commercial
\brief Page accueil de la zone mailing
\version $Revision$
@@ -119,19 +120,21 @@ print '
';
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql .= " LIMIT 10";
-if ( $db->query($sql) )
+$result=$db->query($sql);
+if ($result)
{
- $num = $db->num_rows();
+ print '';
+ print '| '.$langs->trans("LastMailings",10).' | '.$langs->trans("Status").' | ';
+
+ $num = $db->num_rows($result);
if ($num > 0)
{
- print '';
- print '| '.$langs->trans("LastMailings",10).' | '.$langs->trans("Status").' | ';
$var = true;
$i = 0;
while ($i < $num )
{
- $obj = $db->fetch_object();
+ $obj = $db->fetch_object($result);
$var=!$var;
print "";
@@ -143,9 +146,13 @@ if ( $db->query($sql) )
$i++;
}
- print " ";
}
- $db->free();
+ else
+ {
+ print '| '.$langs->trans("None").' | ';
+ }
+ print " ";
+ $db->free($result);
}
else
{
|