{"action":"created","issue":{"url":"https://api.github.com/repos/vitalets/x-editable/issues/507","labels_url":"https://api.github.com/repos/vitalets/x-editable/issues/507/labels{/name}","comments_url":"https://api.github.com/repos/vitalets/x-editable/issues/507/comments","events_url":"https://api.github.com/repos/vitalets/x-editable/issues/507/events","html_url":"https://github.com/vitalets/x-editable/issues/507","id":27046489,"number":507,"title":"X-Editable & PHP & MySql","user":{"login":"PecadoX","id":6512410,"avatar_url":"https://avatars.githubusercontent.com/u/6512410?v=3","gravatar_id":"","url":"https://api.github.com/users/PecadoX","html_url":"https://github.com/PecadoX","followers_url":"https://api.github.com/users/PecadoX/followers","following_url":"https://api.github.com/users/PecadoX/following{/other_user}","gists_url":"https://api.github.com/users/PecadoX/gists{/gist_id}","starred_url":"https://api.github.com/users/PecadoX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PecadoX/subscriptions","organizations_url":"https://api.github.com/users/PecadoX/orgs","repos_url":"https://api.github.com/users/PecadoX/repos","events_url":"https://api.github.com/users/PecadoX/events{/privacy}","received_events_url":"https://api.github.com/users/PecadoX/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-02-06T12:42:07Z","updated_at":"2015-04-29T06:07:12Z","closed_at":"2014-02-24T10:30:59Z","body":"Hello,\r\n\r\nI used X-Editable plug-in and couldn't connect to database to update it. I think I must pust some code into javascript code.\r\n\r\nAny one help me?\r\n\r\nThanks in advance.\r\n\r\nDatabase info;\r\n\r\nTable name is customer\r\ncolumn name that I wanna update is customer_name\r\n\r\nHTML code is;\r\n\r\na href=\"#\" id=\"customer_name\" name=\"customer_name\" data-type=\"text\" data-placement=\"top\" data-title=\"Enter New Customer Name\" class=\"editable editable-click\" data-pk=\"<?php echo $rowID; ?>\" data-url=\"../includes/php/update.php\"><?php echo $customer_name; ?></a\r\n\r\nJavascript code is;\r\n\r\n$(document).ready(function() {\r\n    $.fn.editable.defaults.mode = 'popup';  \r\n    $('#customer_name').editable();\r\n\r\nAnd update.php code is;\r\n\r\n$customer_name = $_POST['name'];\r\n$ID = $_POST['pk'];\r\n$value = $_POST['value'];\r\n\t\r\nmysql_query('UPDATE customer SET ' . $customer_name . '=' . $value . ' WHERE ID = ' . $ID);"},"comment":{"url":"https://api.github.com/repos/vitalets/x-editable/issues/comments/97317411","html_url":"https://github.com/vitalets/x-editable/issues/507#issuecomment-97317411","issue_url":"https://api.github.com/repos/vitalets/x-editable/issues/507","id":97317411,"user":{"login":"Narender-Sharma","id":12154018,"avatar_url":"https://avatars.githubusercontent.com/u/12154018?v=3","gravatar_id":"","url":"https://api.github.com/users/Narender-Sharma","html_url":"https://github.com/Narender-Sharma","followers_url":"https://api.github.com/users/Narender-Sharma/followers","following_url":"https://api.github.com/users/Narender-Sharma/following{/other_user}","gists_url":"https://api.github.com/users/Narender-Sharma/gists{/gist_id}","starred_url":"https://api.github.com/users/Narender-Sharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narender-Sharma/subscriptions","organizations_url":"https://api.github.com/users/Narender-Sharma/orgs","repos_url":"https://api.github.com/users/Narender-Sharma/repos","events_url":"https://api.github.com/users/Narender-Sharma/events{/privacy}","received_events_url":"https://api.github.com/users/Narender-Sharma/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T06:07:12Z","updated_at":"2015-04-29T06:07:12Z","body":"i have some problam with x-editable, i get the value from sql but how to update the in sql \r\n\r\nhtml code\r\n<a href=\"javascript:;\" id=\"username\" data-type=\"text\" data-pk=\"1\" data-original-title=\"Enter First Name\">\r\n<?php echo $data['first_name']; ?></a>\r\n\r\n\r\n\r\nJavaScript code\r\n\r\n $('#username').editable({\r\n            url: '/post',\r\n            type: 'text',\r\n            pk: 1,\r\n            name: 'username',\r\n            title: 'First Name',\r\n\t\t\t validate: function (value) {\r\n                if ($.trim(value) == '') return 'This field is required';\r\n            }\r\n\r\n        }); "}}