Re: [PHP-DB] Connecting to more than 2 databases from a single PHP script.

2007-08-20 Thread Goltsios Theodore
You can still use PDO in order to access as many databases you need 
using different handlers. This is a way for e.g.


 $dbhost1 = 'localhost';
 $dbuser1 = 'test';
 $dbpass1 = '12345';
 $db1 = 'database_name';
 $dbh1 = new PDO('mysql:host='.$dbhost1.';dbname='.$db1, $dbuser1, 
$dbpass1);


 $dbhost2 = 'database.example.net';
 $dbuser2 = 'test';
 $dbpass2 = '12345';
 $db2 = 'database_name';
 $dbh2 = new PDO('mysql:host='.$dbhost2.';dbname='.$db2, $dbuser2, 
$dbpass2);


You can query the database buy doing:

  $sth = $dbh->prepare($query);
  $sth->execute();

Have in mind that mysql is not the only option you have but you should 
check the documentation for more info.


http://www.php.net/manual/el/ref.pdo.php

Chris wrote:

Suamya Srivastava wrote:

Hello,

In a single PHP code, I want to connect to two mysql databases with
totally different authentication information. Is it possible?


See http://php.net/mysql_connect - you need to set 'new_link' to true 
in the mysql_connect call.




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] help

2007-08-20 Thread subramani
On 8/20/07, Asim <[EMAIL PROTECTED]> wrote:
> can anyone provide me code of basic website structure having member
>  area and can use mysql database to show results of search by PAGINATION?

For pagination refer this :- http://www.phpfreaks.com/tutorials/43/5.php
Hope this will help you.

--- R * Subramani
My Log File : http://rsubramani.wordpress.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] help

2007-08-20 Thread Asim
Hi
 
can anyone provide me code of basic website structure having member
 area and can use mysql database to show results of search by PAGINATION?
 
   
   
  can anyone give me code of php webpage that gets results from
 database mysql and show them in pages to website content is IMAGES THAT ARE
 EXTRACTED FROM DATABASE AS PATH TO THEM and then displayed as hyperlink
   
   
   
  
BYE



Asim Jamil  - 0092 345 4025907, Pakistan
   
-
Pinpoint customers who are looking for what you sell.