由 frode » 2010-03-23 15:50
Jack你好,非常感谢你上次的帮助,这次还期待你的援手.
我按照你这个指点新建了一个数据库 vka_categories_attributes
在/includes/extra_datafiles 新建了 vka_categories_attributes_database_tables.php,内容是
<?php
//Categories Attributes Table
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
define('TABLE_CATEGORIES_ATTRIBUTES', DB_PREFIX . 'vka_categories_attributes');
?>
在代码页面我实施以下语句
$sql = "insert into " .TABLE_CATEGORIES_ATTRIBUTES. " (categories_id,options_id,options_values_id,admin) values (1,2,3,'frode')";
$db->Execute($sql);
为什么会报
1146 Table 'zc_db.table_categories_attributes' doesn't exist
in:
[insert into TABLE_CATEGORIES_ATTRIBUTES (categories_id,options_id,options_values_id,admin) values (1,2,3,'frode')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
呢?这个数据库已经建立了,看情况应该是没有载入vka_categories_attributes_database_tables.php,导致无法识别已经定义过的 TABLE_CATEGORIES_ATTRIBUTES
如果我把define('TABLE_CATEGORIES_ATTRIBUTES', DB_PREFIX . 'vka_categories_attributes');写在\includes\database_tables.php里就是正常的.
期待你的回答,非常感谢!