I had changed the db name to new database for the second one. 


----- Original Message ----
From: HardyBoyz <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, April 20, 2008 11:41:11 PM
Subject: Re: [php_mysql] displaying results from different db

I think the problem is in your first database, the table is registered, and in 
another database, the table that you want to manipulated is not registered. 
So, You must change the $dbname in mysql_select_ db function to your db that do 
you want to manipulated.
correct me if i'm wrong.

Tedit kap <[EMAIL PROTECTED] com> wrote: Is it possible to display results from 
more than one database in one single page? I have a page that displays results 
from two tables in a single page and it was working fine. But when I added a 
table from another database, (although it doesnt give a connection error) it 
does not display the results from that other database's table. And I am getting 
the following error, although the same line was working in the first database's 
tables. 

Warning: mysql_fetch_ array(): supplied argument is not a valid MySQL result 
resource in /home/content/ .......php on line 17

and here is that line 17:

while ($row = mysql_fetch_ array($query) )

for reference here is the whole program - this was working fine for the first 
database tables:

<?php
//Connect To Database
$hostname='. ...';
$username='. ...';
$password='. ...';
$dbname='... .';
$usertable=' birds';

mysql_connect( $hostname, $username, $password) OR DIE ('Unable to connect to 
database! Please try again later.');
mysql_select_ db($dbname) ;

$query=mysql_ query("select * from birds");
while ($row = mysql_fetch_ array($query) ) {
echo"<br/><p class='newstitle1' > bbbb1: " . $row['newsid' ] . "<br/> 
coltitle1: " . $row['id'] . 
"<br/> <p id=newstext1> pppp1: " . $row['name'] ;}

?> 

____________ _________ _________ _________ _________ _________ _
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. Try it now. http://mobile. yahoo.com/ 
;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ

[Non-text portions of this message have been removed]





------------ --------- --------- ---
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

[Non-text portions of this message have been removed]


 


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[Non-text portions of this message have been removed]

Reply via email to