Date format problem [message #229] |
Fri, 04 August 2006 16:36 |
haribole
Messages: 7 Registered: July 2006 Location: Cary
|
Junior Member |
|
|
Hi
I am getting an error when I add a record in a table with a date column in it.
Am not sure what format the Date should be entered while adding a record.
thanks
Hari
Fatal Error: MySQL error: 1064 : 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 (# 256).
SQL query: SELECT count(*) FROM srisri WHERE
Error in line 241 of file '/home/esatsang/admindev/includes/dml.mysql.class.inc'.
Script: /aolcenters/srisri.add.php
User Id: HARI
Remote Address: 129.33.49.251
Request URI: /aolcenters/srisri.add.php
|
|
|
Re: Date format problem [message #230 is a reply to message #229] |
Fri, 04 August 2006 18:00 |
AJM
Messages: 2371 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
The error you show indicates a problem with a SELECT statement, not an INSERT. It looks like it's doing a SELECT to check that the record does not already exist just before the INSERT, but it has not loaded the primary key into the WHERE clause. What does your <table>.dict.inc file look like?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
Re: Date format problem [message #233 is a reply to message #229] |
Sun, 06 August 2006 11:27 |
haribole
Messages: 7 Registered: July 2006 Location: Cary
|
Junior Member |
|
|
Thanks Tony
Here is my srisri.dict.inc
I compared this to an existing working dict.inc, and looks identical.
Hari
<?php
// file created on August 4, 2006, 4:12 pm
// field specifications for table aol.srisri
$fieldspec['id'] = array('type' => 'integer',
'size' => 4,
'auto_increment' => 'y',
'minvalue' => -32768,
'maxvalue' => 32767,
'pkey' => 'y',
'required' => 'y');
$fieldspec['date'] = array('type' => 'date',
'size' => 12,
'required' => 'y');
$fieldspec['city'] = array('type' => 'string',
'size' => 50,
'required' => 'y');
$fieldspec['country'] = array('type' => 'string',
'size' => 50,
'required' => 'y');
$fieldspec['info'] = array('type' => 'string',
'size' => 50,
'required' => 'y',
'control' => 'multiline',
'cols' => 50,
'rows' => 5);
// primary key details
$this->primary_key = array();
// unique key details
$this->unique_keys = array();
// child relationship details
$this->child_relations = array();
// parent relationship details
$this->parent_relations = array();
// determines if database updates are recorded in an audit log
$this->audit_logging = TRUE;
// default sort sequence
$this->default_orderby = '';
// finished
?>
|
|
|
Re: Date format problem [message #234 is a reply to message #233] |
Sun, 06 August 2006 11:44 |
AJM
Messages: 2371 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Your problem is the line $this->primary_key = array(); which should really be $this->primary_key = array('id'); I do not know how this happened as I have just tried it on a similar table I have and anything which has also shows up in the $primary_key array.
Try the dictionary export again to see if this corrects the problem, otherwise amend the file by hand.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|