[support] get next nid

bharani kumar bharanikumariyerphp at gmail.com
Mon Nov 3 07:05:26 UTC 2008


function formexample_nameform() {
  $form['first_name'] = array(
     '#title' => t('First Name'),
     '#type' => 'textfield',
     '#description' => t(''),
    );
    $form['annotate']['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid
    );
    $form['last_name'] = array(
     '#title' => t('Description'),
     '#type' => 'textfield',
     '#description' => t(''),
    );

    $form['submit'] = array(
       '#type' => 'submit',
       '#value' => t('submit')
      );


      return $form;
    }



function formexample_nameform_submit($form_id, $form_values) {
global $user;
print $nid = $form_values['annotate'];
print $note = $form_values['first_name'];
$description = $form_values['last_name'];
/*db_query("DELETE FROM {contactus} WHERE uid = %d and nid = %d",
$user->uid,
$nid);*/
db_query("INSERT INTO {contactus} (uid, nid, name,description, timestamp)
VALUES (%d, %d,'%s','%s', %d)", $user->uid, $nid,$note,$description,
time());
drupal_set_message(t('Your contactus was saved.'));
}

How to get the next nid,



-- 
உங்கள் நண்பன்
பரணி  குமார்

Regards
B.S.Bharanikumar

POST YOUR OPINION
http://bharanikumariyer.hyperphp.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20081103/f93f933a/attachment.htm 


More information about the support mailing list