Commit 6a837242 authored by melvinfonda's avatar melvinfonda
Browse files

field fixed

parent 4425b3f1
......@@ -11,5 +11,5 @@ user.properties.file=C:\\Users\\susanti_2\\AppData\\Roaming\\NetBeans\\8.0.2\\bu
>>>>>>> 43e41c8c08f84039568ca701a584f38f9911e548
=======
user.properties.file=C:\\Users\\Stephen\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
user.properties.file=C:\\Users\\user\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
>>>>>>> 9b3bab9e9eefddca873933beff1cff411b869149
......@@ -19,6 +19,6 @@ user.properties.file=C:\\Users\\susanti_2\\AppData\\Roaming\\NetBeans\\8.0.2\\bu
=======
user.properties.file=C:\\Users\\Stephen\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
user.properties.file=C:\\Users\\user\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
>>>>>>> 9b3bab9e9eefddca873933beff1cff411b869149
......@@ -282,13 +282,16 @@ public class MySQLAccess {
}
else //item belom diambil
{
preparedStatement = connect.prepareStatement("SELECT id_item FROM items WHERE "+ "id_other=\"" + id_other + "\";");
preparedStatement = connect.prepareStatement("SELECT * FROM items WHERE "+ "id_other=\"" + id_other + "\";");
resultSet = preparedStatement.executeQuery();
if(resultSet.first()) {
int item_taken = resultSet.getInt("id_item");
//map dijadikan kosong
TCPServer.map[curr_x][curr_y] = "";
//masukkan ke inventory
preparedStatement = connect.prepareStatement("UPDATE inventory SET "
+ resultSet.getString("item_name").toLowerCase() + "="
+ resultSet.getString("item_name").toLowerCase() + "+1"
+ " WHERE id_user=" + userID + ";");
preparedStatement.executeUpdate();
//kembalikan response
response.put("status", "ok");
response.put("item", item_taken);
......
Supports Markdown
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