Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "config.php";
- if (!isset($_POST['id']) || !isset($_POST['sunda']) || !isset($_POST['label'])) {
- echo '("status": "Error", "message": "Category ID,Sunda and Label required.")';
- exit();
- }
- $id = $_POST['id'];
- $sunda = $_POST['sunda'];
- $label = $_POST['label'];
- $sql = "UPDATE word SET label='$label', sunda='$sunda' WHERE id='$id'";
- if(mysqli_query($conn, $sql)){
- if (mysqli_affected_rows($conn) > 0) {
- echo '("Status":"Success")';
- }else{
- echo '("status": "Error","message":"No word with corresponding ID.")';
- }
- echo '("status": "Success","wordId": '.mysqli_insert_id($conn) .')';
- }
- else{
- echo '("status": "Error","message": "'.mysqli_error($conn) .'")';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement