double queries
| From: | mike@stratabase | Date: | Fri, 25 Feb 2000 07:36:48 +0000 |
| Subject: | double queries | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-10923@lists.php.net to get a copy of this message | ||
I need to do a query on two databases.. what i am going to do is pull the email addresses for one of
them and compare it to the other, if the email address is the same then i will update the info for
the other database... here is my starting out code, i cant get the second query to go past one
result and compare teh email address with the first query...
<?
$hostname = "yyyyy";
$username = "yyyyy";
$dbName = "yyyyyy";
MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database");
@mysql_select_db("$dbName") or die("Unable to select database");
$investfacts = mysql_query("select
* from radio");
$investfactsNumber = mysql_numrows($investfacts);
while ($investfactsResult = mysql_fetch_array($investfacts)){
$email5 = $investfactsResult[email];
echo $email5?><br>
<?
$hostname = "xxxxxxx";
$username = "xxxx";
$dbName = "xxxxxxx";
MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database");
@mysql_select_db("$dbName") or die("Unable to select database");
$sbcontact = mysql_query("select
email from
subscribers where
email = '$email5'");
$sbcontactNumber = mysql_numrows($sbcontact);?>
<b>the matches!!!</b>
<?while ($sbcontactResult = mysql_fetch_array($sbcontact)){
$email6 = $sbcontactResult[email];
if ($email6 == $email5){
echo $email6;} ?>
<? }
?>
please help i need this done tonight if anyone can help please!!!
:o)
Mikey T