php - Why won't my drupal module show up in the modules list? -
my drupal module won't show me. code is:
.project
<?xml version="1.0" encoding="utf-8"?> <projectdescription> <name>db_connection</name> <comment></comment> <projects> </projects> <buildspec> </buildspec> <natures> </natures> </projectdescription>
db_select_module.info
name=db balance description= test module practice database selecting. core= 7.x
db_select_module_balance.module
function dp_select_module_block_info() { $blocks['dp_select_module'] = array( 'info' => t('database calls'), 'cache' => drupal_cache_per_role, ); return $blocks; } /** * * function data database. */ function dp_select_module_get_data() { $query= db_select('balancetable', 'c') ->fields('c', array('name','username','balance')) ->execute() ->fetchall(); return $query; } /** * implemented block view. */ function dp_select_module_block_view1() { $result= dp_select_module_get_data(); //$items= array(); $output= '<ul>'; foreach($result $key){ $output.= '<li>' .$key->name. '</li>'; $ output.= '<li>' .$key->username. '</li>'; $output.= '<li>' .$key->balance. '</li>'; } $output.= '</ul>'; $block['content'] = $output; return $block; }
my database table details:
table name: balancetable
columns:
id | name | username | balance
so there i'm doing wrong in code? shouldn't module still show there errors? did modify pre-existing module , changed name etc why i'm getting problem?
try renaming db_select_module_balance.module
db_select_module.module
match .info file.
also checking these files in
/sites/all/modules/db_select_module/
Comments
Post a Comment