I was creating a test project on Traq 3.5.1 in the Admin CP. I filled all fields, but forgot to set the display order. The result was the following SQL error:
Incorrect integer value: '' for column 'displayorder' at row 1 INSERT INTO `projects` (`name`, `codename`, `slug`, `info`, `enable_wiki`, `default_ticket_type_id`, `default_ticket_sorting`, `displayorder`, `private_key`) VALUES('Test SQL', 'SQL', 'test-sql', 'Projet de test', '0', '1', 'ticket_id.asc', '', 'd4c4031468caa4dc07b2f71a4c31979188d42ee1')
To reproduce this, go the /admin/projects/new in the admin CP and do not fill the display order field. You will also need to run MySQL in strict mode (for instance, add 'sql_mode = "ANSI,TRADITIONAL' to your MySQL configuration file).
I think you should properly cast this value as an integer before inserting it into the query.
And, perhaps, you should ensure you cannot set the same value for each project, which appears to be the case.
I am running a development install based on Wamp 2.2E with Apache 2.2.22, PHP 5.3.13 and MySQL 5.5.24.