//echo '<script> alert(" Exito al ingresar su imagen"); </script>'; //echo "<script> window.location='index.php'; </script>"; } } else { echo '<script> alert(" Error al ingresar la imagen"); </script>'; echo "<script> window.location='usuarios.php'; </script>"; } $user_id = $_POST['user_id']; $fname = $_POST['first_name']; $lname = $_POST['last_name']; $email1 = $_POST['email']; $lugar1 = $_POST['lugar']; $coordenada1 = $_POST['coordenada_x']; $coordenada2 = $_POST['coordenada_y']; $imagen = $nombre; $res = $con->update($user_id, $fname, $lname, $email1, $lugar1, $coordenada1, $coordenada2, $imagen); if ($res) { ?> <script> alert('Exito al modificar'); window.location='usuarios.php' </script> <?php } else { ?> <script> alert('Error al modificar'); window.location='usuarios.php' </script> <?php }
<?php include_once 'dbMySql.php'; $con = new DB_con(); $table = "car"; // data insert code starts here. if (isset($_GET['edit_id'])) { $sql = mysql_query("SELECT * FROM car WHERE VehicleID=" . $_GET['edit_id']); $result = mysql_fetch_array($sql); } // data update code starts here. if (isset($_POST['btn-update'])) { $DailyRate = $_POST['DailyRate']; $WeeklyRate = $_POST['WeeklyRate']; $id = $_GET['edit_id']; $res = $con->update($table, $id, $DailyRate, $WeeklyRate); if ($res) { ?> <script> alert('Updated..Go back and check'); window.location='index.php' </script> <?php } else { ?> <script> alert('Error updating record...'); window.location='index.php' </script> <?php }