Page 1 of 1

Can't execute SQL: INSERT INTO `hesk_replies`

Posted: Thu Feb 05, 2009 3:43 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: hesk_replies, staffid, Can't execute SQL

Write your message below:

Can't execute SQL: INSERT INTO `hesk_replies` ( `replyto`,`name`,`message`,`dt`,`attachments` ) VALUES ( '1','Mark Sarpy','can you fix that?',NOW(),'' )

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

Please notify webmaster at

every time i reply to my own ticket i get that error, admin can reply but you cant reply to your own ticket.. im running PHP 5.2.8 and mySQL server 5.0 if that matters.

Posted: Thu Feb 05, 2009 4:04 pm
by Klemen
1. Save this code as dbupdate.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']."replies` CHANGE `staffid` `staffid` SMALLINT( 5 ) DEFAULT 0 "; 
hesk_dbQuery($sql); 

$sql = "ALTER TABLE `".$hesk_settings['db_pfix']."replies` CHANGE `rating` `rating` ENUM( '1','5' ) DEFAULT NULL "; 
hesk_dbQuery($sql); 


echo "Database modified"; 
?>
2. upload to server
3. open in browser
4. delete the file from the server

Posted: Thu Feb 05, 2009 4:17 pm
by killcount
Thank you sir! work good now. :D