<?php
/**
* MiniClick
* Gestionnaire de tableau collaboratif
* Copyright (C) 2006 Guillaume Monet <gm@ibreizh.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
*
* @package miniclick
* @version 5.0.0
*/
session_start();
include("includes/connection.php");
$remplacer = $_POST["remplacer"];
$par = $_POST["par"];
$table = $_POST["table"];
$colonne = $_POST["colonne"];
$key = $_POST['key'];
$select = stripslashes(stripslashes($_POST["select"]));
$where = stripslashes(stripslashes($_POST["where"]));
$having = stripslashes(stripslashes($_POST["having"]));

mysql_query("INSERT INTO ARCHIVAGE VALUES('','$table','".$ligne->$key."','$value','".$pre->$value."','".date('ymdHis')."','')");

//Format de la requete UPDATE table SET colonne=qqch WHERE colonne like qqch AND key IN (SELECT key FROM (SELECT select FROM table WHERE where HAVING HAVING) AS TEMP))
mysql_query("UPDATE $table SET $colonne = REPLACE($colonne,'$remplacer','$par')  WHERE $colonne like '%$remplacer%' AND $where");
echo "UPDATE $table SET $colonne = REPLACE($colonne,'$remplacer','$par')  WHERE $colonne like '%$remplacer%' AND $where";
?>
<html>
<body  onload="window.close(); window.opener.location.reload(true);">
</body>
</html>
