Problem with Xataface Depselect
Archived from the Xataface Users forum.
muzafar — Mon Apr 23, 2012 4:58 am
Greetings,
I am using the xataface depselect module. I have put the modules in my xataface directory which is outside my site directory i.e.
xampp/htdocs/sitename/xata/modules/depselect
I have added this in my conf.ini file as well.
[_modules]
modules_depselect=modules/depselect/depselect.php
I have created two tables namely, provinces, districts and i will extend to more if it works, the structure and it’s dumb data is given below:
CREATE TABLE IF NOT EXISTS provinces (
province\_id int(11) NOT NULL AUTO_INCREMENT,
province\_name varchar(64) NOT NULL,
province\_code varchar(32) DEFAULT NULL,
PRIMARY KEY (province\_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
–
– Dumping data for table provinces
–
INSERT INTO provinces (province\_id, province\_name, province\_code) VALUES
(1, ‘Khyber Pakhtoonkhwa’, ‘KPK’),CREATE TABLE IF NOT EXISTS provinces (
province\_id int(11) NOT NULL AUTO_INCREMENT,
province\_name varchar(64) NOT NULL,
province\_code varchar(32) DEFAULT NULL,
PRIMARY KEY (province\_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
–
– Dumping data for table provinces
–
INSERT INTO provinces (province\_id, province\_name, province\_code) VALUES
(1, ‘Khyber Pakhtoonkhwa’, ‘KPK’),
And the districts table is:
CREATE TABLE IF NOT EXISTS districts (
distt\_id int(11) NOT NULL AUTO_INCREMENT,
province\_id int(11) DEFAULT NULL,
distt\_name varchar(64) DEFAULT NULL,
distt\_code varchar(32) DEFAULT NULL,
PRIMARY KEY (distt\_id),
KEY province\_id (province\_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
–
– Dumping data for table districts
–
INSERT INTO districts (distt\_id, province\_id, distt\_name, distt\_code) VALUES
(1, 1, ‘Peshawar’, ‘Pesh’),
(2, 1, ‘Kohat’, ‘Ko’),
(3, 2, ‘Lahore’, ‘Lh’);
–
– Constraints for dumped tables
–
–
– Constraints for table districts
–
ALTER TABLE districts
ADD CONSTRAINT districts\_ibfk\_1 FOREIGN KEY (province\_id) REFERENCES provinces (province\_id);
but when I go to the browser and give the the following url: http://demo.cvp.org/grants/index.php?-a … =provinces
it only shows the province table fields and not the districts table. you can see the form view in attached snapshot as well. my fields.ini file for provinces is like this.
[province_id]
widget:type=depselect
widget:table=provinces
[distt_id]
widget:type=depselect
widget:table=districts
widget:filters:province_id=”$province_id”
I have created tables/provinces directory in tables directory with provinces.p not the tables/districts directory yet.
kindly lead me, and tell me what i am doing wrong.
looking forward for your reply.
Jean — Mon Apr 23, 2012 11:51 pm
Hello Muzafar,
Which Xataface version have you ?
Jean
simbioc — Tue Apr 24, 2012 1:48 am
Use another table and from there call these “child” tables.
It works