DUS 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 DUS. If not, see <http://www.gnu.org/licenses/>. */ // DUS is Dynamic UUID System for Prims // W. Hager founder and project leader include "dus-lib.php"; if (file_exists($DbName)) { $DusArr = load_array_dump($DbName); } else { $DusArr = array(); } if ($Methode == "UPD") { CleanUp(); // remove old records TTL time out if (array_key_exists($objectkey, $DusArr)) { write_log("dus.log", "{$objectkey} Update"); } else { write_log("dus.log", "{$objectkey} Create"); } UpdateRecord($objectkey, $PrimUrl, $PrimTtl); save_array_dump($DbName, $DusArr); } if ($UUID != "") { write_log("dus.log", "{$UUID} Get url"); echo GetUrl($UUID); }
<?php include_once "dbconfig.php"; if ($_POST['o']) { $data = json_decode($_POST['o']); foreach ($data as $d) { $local_id = $d->id; $local_id = explode("_", $local_id); if ($local_id[0] == "newrow") { SaveRecord($d); } else { UpdateRecord($d); } } ///endforeach } //end $_POST[o] function UpdateRecord($d) { $query = " update `projects` set "; $colname = "`highlevelideano`='" . $d->highlevelideano . "'"; $colname .= ",`name`='" . $d->name . "'"; $colname .= ",`projectno`='" . $d->projectno . "'"; if ($colname != '') { $query = $query . $colname . " where `id`=" . $d->id; $db = mysql_connect("localhost", "root", "") or die("Connection Error: " . mysql_error()); mysql_select_db("samproject") or die("Error conecting to db."); if (mysql_query($query)) { echo $query; //header("location:index.html"); } else {