Page 1 of 2

show and edit data from other database

Posted: Thu Jun 07, 2012 8:00 pm
by johan
Hi,

I wan't to show and edit a table from one database in another.

My database I opened is reg_onthaal.
With this sql I create my form (browsescreen)

Code: Select all

select w.*, c.*  from reg_begeleidingsteam.wachtlijsten w 

left join reg_begeleidingsteam.clienten c on cl_id = wl_cl_id
left join reg_begeleidingsteam.wachtlijst_locatie on loc_id = wl_loc_id
left join reg_begeleidingsteam.problemen on wl_probleem = pro_id
left join reg_begeleidingsteam.beschikbaarheid on wl_beschikbaar = bes_id
left join reg_begeleidingsteam.reden_afsluit on afs_id = wl_reden_eind

where wl_eind is null 

order by wl_loc_id, wl_start
When I open my browse screen, I get the data as espected. But when I try to open my edit form I get an error
Table 'reg_onthaal.reg_begeleidingsteam.wachtlijsten' doesn't exist
Any idea if and how I can solve this?

Thanks again
Johan

Re: show and edit data from other database

Posted: Thu Jun 07, 2012 9:55 pm
by massiws
johan,
look at this post: http://forums.nubuilder.cloud/viewtopic.php?f=4&t=7876
I think it's a quotes problem.

...JOIN 'table'.'field' ON ....

Bye

Re: show and edit data from other database

Posted: Thu Jun 07, 2012 10:28 pm
by johan
massiws,

I don't have a problem joining 2 or more tables from the same database.


The problem appears when I try to edit a table from another database in nubuilder.
Johan

Re: show and edit data from other database

Posted: Fri Jun 08, 2012 12:56 am
by massiws
Sorry, I read the post too fast! :oops:
Better wait the opinion of experts; the only thing that comes to mind is to create a temporary table or a view in mysql.
Bye

Re: show and edit data from other database

Posted: Fri Jun 08, 2012 3:29 am
by shane
the current way that nuRunQuery works is to connect to a single database.

you do not need to use nuRunQuery in your custom code sections, be in areas where you place direct SQL statements into nuBuilder, then nuBuilder will be using nuRunQuery.

Re: show and edit data from other database

Posted: Fri Jun 08, 2012 9:55 am
by johan
Shane,

If I understand your post correct, it is'nt possible now.

Johan

Re: show and edit data from other database

Posted: Tue Jun 12, 2012 1:47 am
by shane
yes not possible using nuRunQuery, if you make your own function to replace nuRunQuery it should be possible.

Re: show and edit data from other database

Posted: Tue Jun 12, 2012 5:10 am
by johan
Shane,

Problem is that I don't know how. (php part)
That's why nuBuilder works so good for me :D

Johan

Re: show and edit data from other database

Posted: Wed Jun 13, 2012 7:44 am
by admin
johan,

nuBuilder can't do it.

nuRunQuery() uses the info from config.php

Code: Select all

<?php

$DBHost                 = "127.0.0.1";
$DBName                 = "sample";
$DBUser                 = "sample";
$DBPassword             = "samplepass";
$DBGlobeadminPassword   = "sampleglobeadmin";

?>
Which only references one database.

Steven

Re: show and edit data from other database

Posted: Wed Jun 13, 2012 8:01 am
by johan
Steven, Shane,

Now, I've created a report that uses info from the other db, that works to show the info.


Johan