Skip to content
Snippets Groups Projects

Projekers - 13515051 - Girvandi Ilyas

Open Girvandi Ilyas requested to merge projekers/TugasBesar1_2017:master into master
Viewing commit 71004957
Show latest version
1 file
+ 10
4
Preferences
Compare changes
+ 10
4
@@ -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);
}