Can't execute SQL: INSERT INTO `hesk_kb_categories`

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
killcount
Posts: 12
Joined: Thu Feb 05, 2009 3:30 pm

Can't execute SQL: INSERT INTO `hesk_kb_categories`

Post 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
eric.carson
Posts: 2
Joined: Thu Feb 12, 2009 8:46 pm

Same error for I

Post 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
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
eric.carson
Posts: 2
Joined: Thu Feb 12, 2009 8:46 pm

Perfect!

Post by eric.carson »

I am honored to report that the update patch fixed the problem. Many thanks!
Post Reply