Can't execute SQL: INSERT INTO `hesk_kb_articles`
Moderator: mkoch227
Can't execute SQL: INSERT INTO `hesk_kb_articles`
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: save article, hesk_kb_articles,
Write your message below:
# Can't execute SQL: INSERT INTO `hesk_kb_articles` (`catid`,`dt`,`author`,`subject`,`content`,`type`,`html`,`art_order`,`history`) VALUES ('1',NOW(),'2','Tester','texts goes here!','0','1','10','On 02-05-2009 15:30 submitted by Mark Sarpy (Mark Sarpy)
')
MySQL said:
Field 'rating' doesn't have a default value
Please notify webmaster at
Everytime i try to save article i get that error. im running PHP 5.2.8 and mySQL server 5.0 if that matters.
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: save article, hesk_kb_articles,
Write your message below:
# Can't execute SQL: INSERT INTO `hesk_kb_articles` (`catid`,`dt`,`author`,`subject`,`content`,`type`,`html`,`art_order`,`history`) VALUES ('1',NOW(),'2','Tester','texts goes here!','0','1','10','On 02-05-2009 15:30 submitted by Mark Sarpy (Mark Sarpy)
')
MySQL said:
Field 'rating' doesn't have a default value
Please notify webmaster at
Everytime i try to save article i get that error. im running PHP 5.2.8 and mySQL server 5.0 if that matters.
Can you check in phpMyAdmin what table types you have? Is MyISAM or InnoDB or some other?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
No, it's not something you are doing wrong I'm just trying to figure out why all these errors started.
Please go to your phpMyAdmin again and in the database structure (where all your tables in the database are listed) see what is says under "Type" for all your Hesk databases.
Please go to your phpMyAdmin again and in the database structure (where all your tables in the database are listed) see what is says under "Type" for all your Hesk databases.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
This should fix it:
If you get any other errors you can post them here, no need to open a new topic.
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_articles` CHANGE `rating` `rating` FLOAT DEFAULT '0' ";
hesk_dbQuery($sql);
$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_articles` CHANGE `votes` `votes` MEDIUMINT(8) UNSIGNED DEFAULT '0' ";
hesk_dbQuery($sql);
$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_articles` CHANGE `views` `views` MEDIUMINT(8) UNSIGNED DEFAULT '0' ";
hesk_dbQuery($sql);
$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_articles` CHANGE `type` `type` ENUM('0','1','2') DEFAULT '0' ";
hesk_dbQuery($sql);
$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_articles` CHANGE `html` `html` ENUM('0','1') DEFAULT '0' ";
hesk_dbQuery($sql);
$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."kb_articles` CHANGE `art_order` `art_order` SMALLINT(5) UNSIGNED DEFAULT '0' ";
hesk_dbQuery($sql);
echo "Database modified";
?>
Last edited by Klemen on Fri Feb 06, 2009 5:58 pm, edited 1 time in total.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Try again, I modified the above code.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Can't execute SQL: INSERT INTO `hesk_kb_categories`
The above script fixed problem of adding a article but I still get the error when trying to add a new category
Can't execute SQL: INSERT INTO `hesk_kb_categories` (`name`,`parent`,`cat_order`,`type`) VALUES ('Software','1','20','0')
MySQL said:
Field 'articles' doesn't have a default value
Please notify webmaster at dbower@greenetweed.com
Can't execute SQL: INSERT INTO `hesk_kb_categories` (`name`,`parent`,`cat_order`,`type`) VALUES ('Software','1','20','0')
MySQL said:
Field 'articles' doesn't have a default value
Please notify webmaster at dbower@greenetweed.com
Please try searching the forum:
viewtopic.php?t=2353
viewtopic.php?t=2353
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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