db_query() is not recomended for INSERT, UPDATE, or DELETE queries. As per its documentation, Those should be handled via db_insert(), db_update() and db_delete() respectively.

Its not the default behaviour of the JQuery to call a PHP function directly, but this can be done calling a page cotaining PHP funtion in it.

But here is how to do it in DRUPAL.

We can use hook_menu to do this magic. Value in 'page callback' will be used as call back function in jquery.

Subscribe to RSS - Drupal