Page 1 of 1
Can't execute SQL: INSERT INTO `hesk_kb_articles`
Posted: Thu Feb 05, 2009 9:35 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: 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.
Posted: Fri Feb 06, 2009 10:23 am
by Klemen
Can you check in phpMyAdmin what table types you have? Is MyISAM or InnoDB or some other?
Posted: Fri Feb 06, 2009 2:08 pm
by killcount
Sure.
hesk_attachments
hesk_categories
hesk_kb_articles
-id
-catid
-dt
-author
-subject
-content
-rating
-votes
-views
-type
-html
-art_order
-history
hesk_kb_categories
hesk_notes
hesk_replies
hesk_std_replies
hesk_tickets
hesk_users
Is it something Im doing wrong?

Posted: Fri Feb 06, 2009 3:11 pm
by Klemen
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.
Posted: Fri Feb 06, 2009 4:00 pm
by killcount
for type it says MyISAM.
i hope thats what your asking for.

Posted: Fri Feb 06, 2009 5:14 pm
by Klemen
This should fix it:
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";
?>
If you get any other errors you can post them here, no need to open a new topic.
Posted: Fri Feb 06, 2009 5:24 pm
by killcount
Can't execute SQL: ALTER TABLE `hesk_kb_articles` CHANGE `history` `history` TEXT DEFAULT ''
MySQL said:
BLOB/TEXT column 'history' can't have a default value
Please notify webmaster at
whats what i got when i tryed to run the dbupdate.php.
Posted: Fri Feb 06, 2009 5:58 pm
by Klemen
Try again, I modified the above code.
Posted: Fri Feb 06, 2009 7:26 pm
by killcount
Thank you sir!

Posted: Wed Feb 11, 2009 4:23 pm
by killcount
i get Can't execute SQL: INSERT INTO `hesk_kb_categories` too.
Posted: Wed Feb 11, 2009 8:06 pm
by killcount
i should of made a new topic

Can't execute SQL: INSERT INTO `hesk_kb_categories`
Posted: Tue Feb 24, 2009 2:53 pm
by dbower
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
Posted: Tue Feb 24, 2009 4:58 pm
by Klemen
Please try searching the forum:
viewtopic.php?t=2353