DB error - creating tables

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
nexusdsl

DB error - creating tables

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

Post by Klemen »

No other permissions are required. Perhaps you already have the tables installed? Have you tried if posting tickets in Hesk works normally?
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
nexusdsl

Submit ticket

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

Post 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
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
koolhandluke4201
Posts: 4
Joined: Sat Jan 21, 2006 4:23 am

same here

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

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

Post 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
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
koolhandluke4201
Posts: 4
Joined: Sat Jan 21, 2006 4:23 am

Post by koolhandluke4201 »

sorry im useing
php5
phpMyAdmin 2.7.0-pl2
apache2
mysql-5.0.18
koolhandluke4201
Posts: 4
Joined: Sat Jan 21, 2006 4:23 am

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

Post 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
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
koolhandluke4201
Posts: 4
Joined: Sat Jan 21, 2006 4:23 am

Post by koolhandluke4201 »

so far all is workin great thank you so much for the fast fix
4ips
Posts: 1
Joined: Tue Sep 05, 2006 7:20 pm

Re: Submit ticket

Post 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'
)
";
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

The file 2 posts above your post fixes the problem
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
Post Reply