Skip to content
Snippets Groups Projects
Commit 71004957 authored by Mikhael Artur Darmakesuma's avatar Mikhael Artur Darmakesuma
Browse files

Added edit add and delete pref loc query

parent 5260559b
1 merge request!42Projekers - 13515051 - Girvandi Ilyas
......@@ -123,17 +123,23 @@ class User {
function addLocation($id, $location) {
$con = mysqli_connect('localhost','root','','projekers');
mysqli_select_db($con, 'projekers');
$image = "pikachu.jpg";
$sql = "INSERT INTO pref_loc (" . $id . ", '" . (string)$location . "')";
mysqli_query($con,$sql);
mysqli_close($con);
}
function updateLocation($id, $location) {
function updateLocation($id, $location1, $location2) {
$con = mysqli_connect('localhost','root','','projekers');
mysqli_select_db($con, 'projekers');
$image = "pikachu.jpg";
$sql = "INSERT INTO pref_loc (" . $id . ", '" . (string)$location . "')";
$sql = "UPDATE pref_loc set location='" . (string)$location2 . "' where id=" . $id . " AND location='" . (string)$location1 . "'";
mysqli_query($con,$sql);
mysqli_close($con);
}
function deleteLocation($id, $location) {
$con = mysqli_connect('localhost','root','','projekers');
mysqli_select_db($con, 'projekers');
$sql = "DELETE FROM pref_loc where id=" . $id . " AND location='" . (string)$location . "'";
mysqli_query($con,$sql);
mysqli_close($con);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment