first off: awesome, awesome, AWESOME piece of code! This will make my coding life so much easier. Thank you
Ok, I'm playing around with the code but I'm running into something odd. I have 2 tables :
[b]bitauth_users[/b]
- user_id
- username
- etc
[b]bitauth_userdata[/b]
- userdata_id
- user_id
- full_name
I set
$crud->set_table('bitauth_users');but nothing happens. Printing the sql gives me
$crud->set_relation('user_id','bitauth_userdata','fullname');
SELECT `bitauth_users`.*, je8701ad4.fullname AS se8701ad4 FROM (`bitauth_users`) LEFT JOIN `bitauth_userdata` as je8701ad4 ON `je8701ad4`.`userdata_id` = `bitauth_users`.`user_id` LIMIT 25
As you can see it refers to userdata_id instead of user_id. Is this a bug or am I missing something?
EDIT: Ok, I've set
$crud->set_primary_key('user_id','bitauth_userdata');and this returns the correct query
SELECT `bitauth_users`.*, je8701ad4.fullname AS se8701ad4 FROM (`bitauth_users`) LEFT JOIN `bitauth_userdata` as je8701ad4 ON `je8701ad4`.`user_id` = `bitauth_users`.`user_id` LIMIT 25
But still I don't see the dropdown (which I believe I should see) on the edit screen.