NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Create complex form with Db-Form


Joined: 29 Jan 2008
Posts: 3
Reply with quote
Hello all!

Is it possible to have the DB-Form wizard to create a form from several databases? i.e.

tblCountry
-------------
CountryId
CountryName

tblCity
-------------
CityId
CityName
CountryId

tblNeighborhood
-------------------
CountryId
CityId
NeighborhoodId
NeighborhoodName

And i want to create a form that displays a table with the Neighborhoods like this: CountryName, CityName and NeigborhoodName

then when inserting a new Neighborhood to have the input form display the Country and City as Selectboxes with their id values

Is it possible? if so, can you give some guidance?

Thnx in advance!!

Lachof
View user's profileFind all posts by lachofSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
It looks like you mean different tables, not databases. Yes it's possible for example with Oracle, where you can create a view that will join the tables according to your needs and you'll also need to create rules for updating the view. The resulted updatable view can be used in the DB Wizard.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jan 2008
Posts: 3
Reply with quote
Yes tables, sorry Wink

is it possible using MYSQL?
View user's profileFind all posts by lachofSend private message


Joined: 29 Jan 2008
Posts: 3
Reply with quote
Here is what i did, if someone has a better way please let me know:

In the table_tblname.php
Right after the fields array i added this:

Code:
// Get ciudad                                   
$clsCiudad = new ciudadDAL();
$res = $clsCiudad->getCiudades();         
foreach($res as $arr) {
    $f3_values[$arr['IdCiudad']]=$arr['Nombre'];
}


The ciudadDAL class returns an array of cities (ciudad) and i just add them to the values array of the selectbox

This is done for every select iwant to display as name instead of id

Hope it helps someone.
View user's profileFind all posts by lachofSend private message
Create complex form with Db-Form
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic