Thanks for taking the time to look into this with me.
I have two tables 'secureassetshub' and 'images'.
CREATE TABLE IF NOT EXISTS `assetshub` (
`id` int(200) NOT NULL AUTO_INCREMENT,
`item_name` varchar(128) NOT NULL,
`UserID` varchar(32) DEFAULT NULL,
`location` varchar(255) NOT NULL,
`descr` text NOT NULL,
`condition` text NOT NULL,
`stordate` varchar(32) DEFAULT NULL,
`dest` varchar(255) DEFAULT NULL,
`ival` varchar(255) NOT NULL,
`wrhouse` varchar(255) NOT NULL,
`lot` varchar(60) NOT NULL,
`icolor` varchar(32) DEFAULT NULL,
`itag` varchar(32) DEFAULT NULL,
`piece` varchar(32) DEFAULT NULL,
`dimens` varchar(255) DEFAULT NULL,
`assettime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=112 ;
CREATE TABLE IF NOT EXISTS `images` (
`assetID` int(200) NOT NULL,
`creationdate` datetime DEFAULT NULL,
`reImage` varchar(200) NOT NULL,
`imageID` int(200) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`imageID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=56 ;
My assetshub/fields.ini looks like this...
__sql__="SELECT assetshub.*,images.reImage FROM assetshub LEFT JOIN images ON
assetshub.id=images.assetID"
[reImage]
logo=1
savepath="photos"
Type=container
url="photos"
allowed_extensions = "gif,jpg,jpeg,png"
[assetImages]
Type=container
widget:label = "Images"
logo=1
transient=1
relationship=otherImages
widget:type=grid
widget:columns="reImage,assetID"
my assetshub/relationships.ini looks like this. I also defined this relationship in images/relationships.ini.
my images/fields.ini looks like this...
[reImage]
transient=1
relationship=otherImages
logo=1
Type=container
widget:type=ajax_upload
savepath="photos"
url="photos"
allowed_extensions = "gif,jpg,jpeg,png"
[imageID]
widget:type=static
[creationdate]
timestamp=insert
widget:type=hidden
[assetID]
widget:type=static
I can't explain the behavior I'm experiencing, it creates a blank record in my 'assetshub' database. it also displays duplicate records of the images. if I try and delete the duplicates it will delete the entire record.
I hope you can shed some light on this issue.
Thanks again for your help.