Php drupal 6中的drupal_write_记录返回false
当我运行Php drupal 6中的drupal_write_记录返回false,php,drupal,drupal-6,drupal-modules,Php,Drupal,Drupal 6,Drupal Modules,当我运行drupal\u write\u record时,它总是返回false。我已经调试过这个函数,看到在drupal\u write\u record函数中找到的drupal\u get\u schema函数返回false。此外,如果我调试成drupal\u get\u schema函数并查看 $schema = $cached->data; 我的新表不包括在$schema数组中。我尝试过刷新缓存、重新安装模块和运行update.php,但没有任何帮助。如果有帮助,我还包括了我编
drupal\u write\u record
时,它总是返回false。我已经调试过这个函数,看到在drupal\u write\u record
函数中找到的drupal\u get\u schema
函数返回false。此外,如果我调试成drupal\u get\u schema
函数并查看
$schema = $cached->data;
我的新表不包括在$schema
数组中。我尝试过刷新缓存、重新安装模块和运行update.php,但没有任何帮助。如果有帮助,我还包括了我编写的.install文件,该文件将新表添加到数据库中:
<?php
// $Id: my_module.install,v 1.00.0.1 2012/10/21 00:23:32 Exp $
/**
* Implementation of hook_schema().
*/
function my_module_schema() {
$schema = array();
$schema['my_module_pending_inserts'] = array(
'fields' => array(
'id' => array(
'description' => 'primary key',
'type' => 'serial',
'size' => 'tiny',
'not null' => TRUE,
),
'json_array_data' => array(
'type' => 'text',
'not null' => TRUE,
),
'successfully_run' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'date_created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'date_updated' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
)
),
'primary key' => array('id'),
);
return $schema;
}
function jira_reporting_install() {
// Create tables.
drupal_install_schema('my_module_pending_inserts');
}
function my_module_uninstall() {
// Remove tables.
drupal_uninstall_schema('my_module_pending_inserts');
// Delete variables
variable_del('my_module_variable1');
variable_del('my_module_variable2');
variable_del('my_module_variable3');
}
function my_module_update_2() {
$up = array();
$tbl = array(
'fields' => array(
'id' => array(
'type' => 'serial', 'not null' => TRUE
),
'json_array_data' => array(
'type' => 'varchar',
'length' => 250,
'not null' => True
),
'successfully_run' => array(
'type' => 'int'
),
'date_created' => array(
'type' => 'int'
),
'date_updated' => array(
'type' => 'int'
),
),
'primary key' => array('id'),
);
db_create_table(&$up, 'my_module_pending_inserts', $tbl);
return $up;
}
没关系,卸载是我的_架构名称中的一个输入错误你的意思是禁用然后卸载吗?在hook\u installHello中尝试一些调试符号,是的,当我卸载时,我禁用,然后卸载。我确实试过调试hook_安装$schema=drupal\u get\u schema\u未处理($module);也作为空数组返回