Uniformized sql error management

Eldy told me that this is the correct way to handle SQL errors…
This commit is contained in:
Marcos García 2012-08-29 08:37:12 +02:00
parent 70c467e429
commit 89692fb79e
9 changed files with 27 additions and 9 deletions

View File

@ -116,7 +116,9 @@ class box_bookmarks extends ModeleBoxes
}
else
{
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else {

View File

@ -141,7 +141,9 @@ class box_comptes extends ModeleBoxes
}
}
else {
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else {

View File

@ -138,7 +138,9 @@ class box_contracts extends ModeleBoxes
}
else
{
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else

View File

@ -139,7 +139,9 @@ class box_factures_fourn extends ModeleBoxes
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoModifiedSupplierBills"));
}
else {
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else {

View File

@ -114,7 +114,9 @@ class box_fournisseurs extends ModeleBoxes
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers"));
}
else {
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else {

View File

@ -92,7 +92,9 @@ class box_osc_clients extends ModeleBoxes
}
}
else {
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else {

View File

@ -134,7 +134,9 @@ class box_propales extends ModeleBoxes
}
else
{
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else

View File

@ -134,7 +134,9 @@ class box_services_expired extends ModeleBoxes
}
else
{
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}

View File

@ -129,7 +129,9 @@ class box_supplier_orders extends ModeleBoxes
}
else
{
dol_print_error($db);
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
}
}
else