Page 1 of 1

Can't execute SQL: INSERT INTO `hesk_kb_categories`

Posted: Thu Feb 12, 2009 8:34 pm
by killcount
Script URL:
Version of script: 2.0
Hosting company: localhost IIS
URL of phpinfo.php: localhost
URL of session_test.php: localhost
What terms did you try when SEARCHING for a solution: add a categorie, hesk_kb_categories, Field 'articles' doesn't have a default value

Can't execute SQL: INSERT INTO `hesk_kb_categories` (`name`,`parent`,`cat_order`,`type`) VALUES ('FAQ','1','20','0')

MySQL said:
Field 'articles' doesn't have a default value

Please notify webmaster at

When i try to make a Category for my Article i get that. im running PHP 5.2.8 and mySQL server 5.0

Same error for I

Posted: Thu Feb 12, 2009 8:52 pm
by eric.carson
I get the same error as well.

I am running PHP 5.2.8 and MySQL 5.1.31 community via TCP/IP

Posted: Sat Feb 14, 2009 11:01 am
by Klemen
Save this as update_db.php:

Code: Select all

<?php 
define('IN_SCRIPT',1); 
define('HESK_PATH',''); 
require(HESK_PATH . 'hesk_settings.inc.php'); 
require(HESK_PATH . 'language/'.$hesk_settings['language'].'.inc.php'); 
require(HESK_PATH . 'inc/common.inc.php'); 
require(HESK_PATH . 'inc/database.inc.php'); 

hesk_dbConnect(); 

$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_categories` CHANGE `articles` `articles` smallint(5) unsigned NOT NULL DEFAULT '0' "; 
hesk_dbQuery($sql); 

$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_categories` CHANGE `cat_order` `cat_order` smallint(5) unsigned NOT NULL DEFAULT '0' "; 
hesk_dbQuery($sql); 

$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_categories` CHANGE `type` `type` enum('0','1') NOT NULL "; 
hesk_dbQuery($sql); 

echo "Database modified"; 
?>
Upload it to the Hesk folder, run in browser and delete from the server.

Perfect!

Posted: Sat Feb 14, 2009 9:48 pm
by eric.carson
I am honored to report that the update patch fixed the problem. Many thanks!