{"flag":true,"single":true,"pageTitle":"Ajax Jquery: Delete data from db using ajax.","post":{"id":223,"user_id":"1","slug":"ajax-jquery-delete-data-from-db-using-ajax--maz4","title":"Ajax Jquery: Delete data from db using ajax.","body":"<p>index.php<\/p>\r\n<pre class=\"language-markup\"><code>function deleteRow(rowID) {\r\n\tif (confirm('Are you sure??')) {\r\n\t    $.ajax({\r\n\t        url: 'ajax.php',\r\n\t        method: 'POST',\r\n\t        dataType: 'text',\r\n\t        data: {\r\n\t            key: 'deleteRow',\r\n\t            rowID: rowID\r\n\t        }, success: function (response) {\r\n\t            $(\"#country_\"+rowID).parent().remove();\r\n\t            alert(response);\r\n\t        }\r\n\t    });\r\n\t}\r\n}<\/code><\/pre>\r\n<p>ajax.php<\/p>\r\n<pre class=\"language-markup\"><code>if ($_POST['key'] == 'deleteRow') {\r\n    $conn-&gt;query(\"DELETE FROM country WHERE id='$rowID'\");\r\n    exit('The Row Has Been Deleted!');\r\n}<\/code><\/pre>","category_id":"28","is_private":"0","created_at":"2023-11-10T02:37:48.000000Z","updated_at":"2023-11-10T02:37:48.000000Z","category":{"id":28,"user_id":"1","name":"Jquery","slug":"jquery-k1v4","parent_id":"12","created_at":"2023-11-10T01:48:35.000000Z","updated_at":"2023-11-10T01:48:35.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"index.php function deleteRow(rowID) { \tif (confirm('Are you sure??')) { \t    $.ajax({ \t        url: 'ajax.php', \t        method: 'POST', \t   - Ajax Jquery: Delete data from db using ajax. (Updated: November 10, 2023) - Read more about Ajax Jquery: Delete data from db using ajax. at my programming site [SITE]","categories":[]}