Ah right. I will be requiring to output all columns (*) and the sorting field will be decided by a combo box but say the field 'name' for the mement.
Have you any idea how I would og about creating this JOIN using php?
I know how I am able to access 1 database at a time but have no idea how I can open two at the same time.
Code:
$username = "username";
$password = "password";
$database = "database";
#CONNECT TO MYSQL
$dbcnx = @mysql_connect('mysql5.streamline.net',$username,$password) or die("Unable to connect to MySQL");
#CONNECT TO DATABASE
@mysql_select_db($database) or die( "Unable to select database");
$result = mysql_query($sql);
while ( $row = mysql_fetch_array($result) ) {
}
sql for db1:
$sql = "SELECT f.id FROM pokerfavourites f WHERE f.username='" .$bewiseusername. "'";
sql for db2:
SELECT * FROM url u INNER JOIN rating r USING(id) INNER JOIN name n USING(id) INNER JOIN games g USING(id) WHERE n.id = [php array]
How would I go about opening the two databases at the same time (e.g. database1 and database2) and how would I join these two sql queryies by using JOIN?
Bookmarks