I am new to drupal and this is my first cms . I am trying to do insert display edit update and delete operation by creating a custom module and in this process insert and display operation have done but while doing update and delete operation i didnot proceed further.Below is my code that displays the data by fetching from table named form_test . Can any body please suggest how to perform update and delete operation on these data.This is my show.module and i want perform update and delete with in this module.
code....
<?php
function show_menu() {
$items['show'] = array(
'title' => 'show',
'page callback' => 'drupal_get_form',
'page arguments' => array('show_form'),
'access callback' => TRUE,
);
return $items;
}
function show_form($form,&$form_state)
{
$table = 'form_test';
$data = db_select($table,'D')
->fields('D')
->execute();
$form['foo_fieldset'] = array(
'#prefix' => '
',
'#action' => 'test/delete.php',
'#method' => 'POST',
'#tree' => TRUE,
);
$form['foo_fieldset']['header'] = array(
'#markup' => '
Name |
Age |
Email |
Salary |
Option |
',
);
$res=NULL;
for($i=0;$i<$res = $data->fetchAssoc();$i++) {