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

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,

I'm interested in knowing how you did it..

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,

The same way I created all my reports. Only you have to add the name of the other DB in your sql.

ex: When I want to make a report in DB sample using data from the database clients my sql will be

Code: Select all

select * from clients.orders left join clients.adress .... 
This works perfect.

This works also for the browse screen (not the edit) when I create a new form.

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 »

rui,

Are you using nuRunQuery()?


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,

(I suspect your post was meant for me, not Rui? )


This is my complete sql used in PHP Data code of add activity

Code: Select all

$sql ="

CREATE TABLE #dataTable#  SELECT wl_loc_id, curdate() as datum, w.wl_start, l.loc_locatie, c.cl_naam, c.cl_voornaam, c.cl_telefoon, c.cl_gsm, p.pro_probleem, b.bes_beschikbaar,  CURDATE(),
    (YEAR(CURDATE())-YEAR(cl_geboortedatum))
   - (RIGHT(CURDATE(),5)<RIGHT(cl_geboortedatum,5))as leeftijd  from reg_begeleidingsteam.wachtlijsten w 
left join reg_begeleidingsteam.wachtlijst_locatie l on l.loc_id = w.wl_loc_id
left join reg_begeleidingsteam.clienten c on w.wl_cl_id = cl_id
left join reg_begeleidingsteam.problemen p on p.pro_id =  w.wl_probleem
left join reg_begeleidingsteam.beschikbaarheid b on b.bes_id = w.wl_beschikbaar where wl_eind is null order by wl_start";

nuRunQuery($sql);
so yes I used nuRunQuery()

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,

You are right, sorry about that.

Steven
Locked