Hello,
have a page where I am going to be doing multiple queries on different databases.
However I thought my below code would work but it does not seem to resurn any error message nore any result set.
Here is my common database connection file
<?php
//database username and pass
$dblogin = mysql_connect("localhost","sitename_abcd","tx35e2vy") or die("Error connecting: <br><br>".mysql_error());
//public NoizIvy database connection
$nidb = mysql_select_db('sitename_databasea', $dblogin) or die("Error getting db: <br><br>".mysql_error());
//Taskpad database connection
$tpdb = mysql_select_db('sitename_databaseb', $dblogin) or die("Error getting db: <br><br>".mysql_error());
?>
here is my query
<select name="acompanyid">
<?php
$myid ='1';
$comanysql = mysql_query("SELECT Usercompany_connections.Companyid,
Userscompanyinfo.Companyname
from Usercompany_connections, Userscompanyinfo
where Usercompany_connections.Profileid='$myid' AND Usercompany_connections.Companyid = Userscompanyinfo.Companyid", $nidb);
while($comprow = mysql_fetch_array($comanysql)){
extract($comprow);
echo "<option value='$Companyname'>$Companyname</option>";
}
?>
</select>