Fix: SQL Error

This commit is contained in:
Laurent Destailleur 2010-05-31 09:45:15 +00:00
parent 7813ef32ea
commit ba15e00bfc
2 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -276,12 +276,11 @@ class Entrepot extends CommonObject
*/ */
function info($id) function info($id)
{ {
$sql = "SELECT e.rowid, e.datec,"; $sql = "SELECT e.rowid, e.datec, e.tms as datem, e.fk_user_author";
$sql .= " e.datem,"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql .= " fk_user_author"; $sql.= " WHERE e.rowid = ".$id;
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql .= " WHERE e.rowid = ".$id;
dol_syslog("Entrepot::info sql=".$sql);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
@ -124,14 +124,14 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{ {
$_GET["action"] = 'edit'; $_GET["action"] = 'edit';
$_GET["id"] = $_POST["id"]; $_GET["id"] = $_POST["id"];
$mesg = '<div class="error">Fiche non mise <20> jour !' . "<br>" . $entrepot->error.'</div>'; $mesg = '<div class="error">'.$entrepot->error.'</div>';
} }
} }
else else
{ {
$_GET["action"] = 'edit'; $_GET["action"] = 'edit';
$_GET["id"] = $_POST["id"]; $_GET["id"] = $_POST["id"];
$mesg = '<div class="error">Fiche non mise <20> jour !' . "<br>" . $entrepot->error.'</div>'; $mesg = '<div class="error">'.$entrepot->error.'</div>';
} }
} }