One web page - two databases ?

One web page - two databases ?

am 22.01.2005 02:16:12 von johnf

Hi,

I have two php web pages that access a database/table fine. They are
different databases/tables to each other. Is it possible to combine
them on one web page ?

The first page starts something like ;

require('onedb_connection.php');=20
require('somefunctions.php');
@session_start();

< snip >

OnClick=3D"location=3D'onedb_search.php'">





mysql_close($link);
?>

The second has the same table layout and search form and is something
like ;

require('twodb_connection.php');=20
require('somefunctions.php');
@session_start();

< snip >

OnClick=3D"location=3D'twodb_search.php'">





mysql_close($link);
?>

How can I make a web page choice up the top for visitors to
select/execute the first block of code OR the second block=20
of code please ?

Any help on this and/or accessing multiple databases/tables=20
from one web page, in general, will be appreciated.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: One web page - two databases ?

am 22.01.2005 04:08:55 von Daniel da Veiga

This is more a php question than a mysql one, but lets see...
You want to execute code accourding to a user selection, the best way
to do this (the only I can figure out) is a user form... You can use a
variable to either execute the first or the second code like this:

if ($_POST["selection"]=="one"){
//First part of the code
}elseif($_POST["selection"]=="two"){
//Second part
}

On your web page, you'll have something like this:


- Select one!

- Select two!



If I got it right, problem solved...

On Sat, 22 Jan 2005 12:16:12 +1100, johnf@net2000.com.au
wrote:
> Hi,
>
> I have two php web pages that access a database/table fine. They are
> different databases/tables to each other. Is it possible to combine
> them on one web page ?
>
> The first page starts something like ;
>
> > require('onedb_connection.php');
> require('somefunctions.php');
> @session_start();
>
> < snip >
>
> > OnClick="location='onedb_search.php'">
>
>
>

>
> > mysql_close($link);
> ?>
>
> The second has the same table layout and search form and is something
> like ;
>
> > require('twodb_connection.php');
> require('somefunctions.php');
> @session_start();
>
> < snip >
>
> > OnClick="location='twodb_search.php'">
>
>
>

>
> > mysql_close($link);
> ?>
>
> How can I make a web page choice up the top for visitors to
> select/execute the first block of code OR the second block
> of code please ?
>
> Any help on this and/or accessing multiple databases/tables
> from one web page, in general, will be appreciated.
>
> Regards, John.
>

--
Daniel da Veiga
Computer Operator - RS - Brazil

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org