Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

show and edit data from other database

johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

show and edit data from other database

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: show and edit data from other database

Unread post 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
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: show and edit data from other database

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: show and edit data from other database

Unread post 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
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: show and edit data from other database

Unread post 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.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: show and edit data from other database

Unread post by johan »

Shane,

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

Johan
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: show and edit data from other database

Unread post by shane »

yes not possible using nuRunQuery, if you make your own function to replace nuRunQuery it should be possible.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: show and edit data from other database

Unread post by johan »

Shane,

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

Johan
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: show and edit data from other database

Unread post 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
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: show and edit data from other database

Unread post by johan »

Steven, Shane,

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


Johan
Locked