Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Drupal module development - return results from db
Old 06-15-2010, 11:50 AM Drupal module development - return results from db
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
#v6.x

Hi guys

I am wading into the swamp which is known as Drupal and I am neck deep

I am in the mists of developing my own module using the FAPI

How do I return the result from a db query based on the implementation below? (Its a one field search database carry on)

here is what I have so far...
PHP Code:
//////////////////////////////////////////////////////////
// Implementation of hook_menu()
function engineers_menu() {

  
$items = array();

  
$items['engineers'] = array(
                    
'title' => 'Engineers',
                    
'page callback' => 'engineers_form',
                    
'access arguments' => array('access content'),
                    
'type'=> true,
                      );
  return 
$items;

}

/////////////////////////////////////////////////////////
/// get form ////////////////////////////////////////////
function engineers_form(){

   
$output t('test test test');

   
$output .= drupal_get_form('engineers_formfields');

   return 
$output;

}

//////////////////////////////////////////////////////////
// form fields ///////////////////////////////////////////
function engineers_formfields(){

        
$form = array();

        
$form['engineers'] = array(

                        
'#type'=>'fieldset',
                        
'#access'=>user_access('administer nodes'),
                        
'#title'=> t('Search Engineers'),
                        
'#collapsible'=> true,
                        
'#collapsed'=> false,
                        
'#tree'=>true,
        );

        
$form['engineers']['search'] = array(
                        
'#type' => 'textfield',
                        
'#title' => t('Search for Engineers'),
                        
'#size' => 60,
                        
'#maxlength' => 128,
                        
'#required' => true,
        );

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

    return 
$form;
    
}

//////////////////////////////////////////////////////////
// form submit ///////////////////////////////////////////
function engineers_form_submit($form, &$form_state) {

    
$message t('submitted');

    
drupal_set_message($message);


Also the submit hook doesn't fire when I click the button!

Any ideas?
__________________

Please login or register to view this content. Registration is FREE

Last edited by davidj; 06-15-2010 at 11:52 AM..
davidj is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Drupal module development - return results from db
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08101 seconds with 12 queries