database.links.ini question
| From: | Sarah Gray | Date: | Wed, 07 Jul 2004 23:57:23 +0000 |
| Subject: | database.links.ini question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-13537@lists.php.net to get a copy of this message | ||
Hi --
I'm experiencing a puzzling (lack of) behavior that I hope tracks to
something I'm not understanding fully.
I'd much appreciate someone's input.
Do the fields one is linking to in the database.links.ini file need to
be integers in order to work?
If not, continue reading -- if so, well, then -- does anyone have a
workaround suggestion?
Details:
I have a database.links.ini file (named with the database name, not the
word "database"), and only some of the
links I specify in this file are being created in my forms.When the
links are *not* created, a regular text field
displays instead of the drop down menu I am expecting.
For instance, the text of the database.links.ini file is:
[Presentations]
pin_number = Attendees: pin_number
session_id = Countries: country_id
[Attendees]
state_id = States: state_id
city = Countries: country_id
The only link in the file that properly creates a linked field in my
table is session_id.
I can link it to any of the other options that I have specified in the
file, and the dropdown link menu will be created.
None of the other three "work".
So.. I thought perhaps that the fields needed to be a certain data type
(...integer...?). I looked online and found this:
"The databasename.links.ini file contains a section for each table, then
the row that is linked equal to the table and row that it should locate
the row from. It assumes the relationships are non-primary id to primary
id, as the example below shows[...]"
So the data types are as follows (taken from the dataObject classes).
(I'm not showing data types of the fields I'm trying to link, because
they all work when they are paired with session_id, so the problem isn't
them).
pin_number // string(40) not_null primary_key unique_key
session_id // int(3) not_null multiple_key unsigned zerofill (This
is the one that works -- the only int)
state_id // string(2) not_null multiple_key
city // string(40)
*Note -- the reason I am trying to link "city" with country_id is that I
wanted to try using a field that was not identified in any way as a key,
just to see if that was where I was going wrong. It didn't work with
country_id (// string(5) not_null multiple_key) either. I don't have
any other int fields handy to try without regenerating the schema --
which I can't do until tomorrow. I hope my little theory is wrong -- it
seems pretty limiting.
Thanks in advance,
s.