Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » auto_increment (Table with auto increment PK as only column result in error when adding new record)
auto_increment [message #2883] Sun, 12 February 2012 20:59 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Radicore v1.70.0
MySQL v5.5.16

1. Create table with auto increment PK as the only column.

2. Import table and export to php result in dict.inc file with following:
$fieldspec['project_id'] =
array('type' => 'integer',
'size' => 11,
'auto_increment' => 'y',
'minvalue' => -2147483648,
'maxvalue' => 2147483647,
'pkey' => 'y',
'required' => 'y');

3. Create list1 transaction for this table.

4. Add a new record, the following error will show up upon submit:

Fatal Error: MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (# 1064).

SQL query: INSERT INTO a_project SET

Error in line 941 of file 'C:\wamp\www\radicore\includes\dml.mysqli.class.inc'.

Host Info: localhost via TCP/IP
Server Version: 5.5.16-log
Client Version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $, Character sets - client: utf8, - connection: utf8, - database: latin1, - server: latin1

PHP_SELF: /radicore/aa/a_project(add1).php

CURRENT DIRECTORY: C:\wamp\www\radicore\aa

SERVER_ADDR: 127.0.0.1

SERVER_NAME: localhost

HTTP_HOST: localhost

User Id: MGR

REMOTE_ADDR: 127.0.0.1

REQUEST_URI: /radicore/aa/a_project(add1).php
Re: auto_increment [message #2884 is a reply to message #2883] Mon, 13 February 2012 03:54 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Why do you have a table with an auto-increment primary key and no non-key fields?

Re: auto_increment [message #2886 is a reply to message #2883] Fri, 17 February 2012 07:11 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
You haven't answered my question, so I've updated the mysql classes to remove the 'SET' from the 'INSERT INTO $tablename' when there is no field list. See the attached zip file for the updated scripts.

Re: auto_increment [message #2888 is a reply to message #2886] Sat, 18 February 2012 06:08 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
No real immediate purpose really. Just testing and checking different scenarios.
It is a low priority issue.
Previous Topic: postgresql
Next Topic: updateSelection cannot extract token
Goto Forum:
  


Current Time: Thu Nov 28 16:12:32 EST 2024

Total time taken to generate the page: 0.01063 seconds