Page 1 of 1

DB error - creating tables

Posted: Tue Dec 06, 2005 6:50 pm
by nexusdsl
Script URL: http://66.45.88.170/hesk/index.php?a=start
Version of script: 0.93.1
Version of PHP: 4.4.1
Hosting company: myself
Have you searched THIS FORUM for your problem: yes
If so, what terms did you try: db error, creating mysql, Couldn't execute SQL: CREATE TABLE

Write your message below:
Got DB to connect.
Cannot get tables to build. Error below.

Couldn't execute SQL: CREATE TABLE `hesk_categories` ( `id` smallint(5) unsigned NOT NULL auto_increment, `name` varchar(20) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM. Please make sure you delete any old installations of Hesk before installing this version!

Does the user need certain permissions other than db_owner?

Nex

Posted: Tue Dec 06, 2005 11:06 pm
by Klemen
No other permissions are required. Perhaps you already have the tables installed? Have you tried if posting tickets in Hesk works normally?

Submit ticket

Posted: Sat Dec 10, 2005 12:56 am
by nexusdsl
I tried to submit a ticket and this is what i got.....

Error

Can't execute SQL: INSERT INTO `hesk_tickets` ( `id`,`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`ip`,`status` ) VALUES ( '', '2UPN6GUYYY','Lance Brown','lance@bigrockford.com','1','3','test','test',NOW(),'67.176.30.202','1' )

MySQL said:
Incorrect integer value: '' for column 'id' at row 1

Please notify webmaster at lbrown@hostedcti.com

Lance

Posted: Sat Dec 10, 2005 1:33 pm
by Klemen
If you check thru phpMyAdmin are the tables created? If yes try using the "repair tables" link.

If that doesn't work delete the tables and try installing again.

Regards

same here

Posted: Sat Jan 21, 2006 4:35 am
by koolhandluke4201
all seems good till i submit the new ticket i get this error
Can't execute SQL: INSERT INTO `hesk_tickets` ( `id`,`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`ip`,`status` ) VALUES ( '','7U3DPGSPQM','----','*************@yahoo.com','1','3','help','yo',NOW(),'' )

MySQL said:
Incorrect integer value: '' for column 'id' at row 1
i deleted and reinstalled the databases but i still get the same error!
i also get this error when useing the category management and i try to add a new category!
I'm useing all the latest versions of hesk, apache, phpmyadmin and mysql on a windows 2003 server

Posted: Sat Jan 21, 2006 12:38 pm
by Klemen
What's the version of PHP?

Check in phpMyAdmin if all id collums have auto_increment

What version of MySQL are you running (the extact version, not "latest")? If possible try with version 4.x and see if that helps?

Posted: Sat Jan 21, 2006 12:41 pm
by Klemen
Before you try with different MySQLversion, can you upload this file over the original one and see if you can successfully submit a ticket?

http://www.phpjunkyard.com/extras/submi ... mysql5.zip

Posted: Sat Jan 21, 2006 2:27 pm
by koolhandluke4201
sorry im useing
php5
phpMyAdmin 2.7.0-pl2
apache2
mysql-5.0.18

Posted: Sat Jan 21, 2006 2:32 pm
by koolhandluke4201
that worked what ever you changed for the ticket submision, but im still gettting similar error when trying to add a category thru the control panel

Posted: Sun Jan 22, 2006 10:08 am
by Klemen
Seems like MySQL 5 is very strict about some things, please try with these files instead of original ones:

http://www.phpjunkyard.com/extras/mysql5_fix.zip

Please test all the features (posting ticket, replying by admin, replying by customer, adding categories, adding users) and then post back if all works ok.

Regards

Posted: Sun Jan 22, 2006 6:52 pm
by koolhandluke4201
so far all is workin great thank you so much for the fast fix

Re: Submit ticket

Posted: Tue Sep 05, 2006 7:24 pm
by 4ips
nexusdsl wrote:I tried to submit a ticket and this is what i got.....

Error

Can't execute SQL: INSERT INTO `hesk_tickets` ( `id`,`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`ip`,`status` ) VALUES ( '', '2UPN6GUYYY','Lance Brown','lance@bigrockford.com','1','3','test','test',NOW(),'67.176.30.202','1' )

MySQL said:
Incorrect integer value: '' for column 'id' at row 1

Please notify webmaster at lbrown@hostedcti.com

Lance

should loose empty quotes that corerspond to id and put NULL instead OR loose id and '' at all - MySQL take care of auto increment fields on its own, you should apply this changes to submit_ticket.php

should look like that: $sql = "
INSERT INTO `hesk_tickets` (
`id`,`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`ip`,`status`
)
VALUES (
NULL,'$trackingID','$name','$email','$category','$priority','$subject','$message',NOW(),'$_SERVER[REMOTE_ADDR]','1'
)
";

instead of

$sql = "
INSERT INTO `hesk_tickets` (
`id`,`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`ip`,`status`
)
VALUES (
'','$trackingID','$name','$email','$category','$priority','$subject','$message',NOW(),'$_SERVER[REMOTE_ADDR]','1'
)
";

Posted: Tue Sep 05, 2006 11:26 pm
by Klemen
The file 2 posts above your post fixes the problem