stewart715 Posted November 7, 2006 Share Posted November 7, 2006 Thank's so much for any help you can offer. Let me tell you what I have, with examples.I have 2 databases...DATABASE 1: thepdcom_popgalleryTABLE: g2_user[b]g_id g_userName[/b]105 LindaDATABASE 2: thepdcom_popnewTABLE: users[b]name[/b]LindaWhat would you suggest for a script that will output the [b]g_id[/b] (105 above) where [b]name[/b] in users = [b]g_userName[/b] in g2_user? I'm guessing you'd use a JOIN type thing... Thanks again. Link to comment https://forums.phpfreaks.com/topic/26412-comparing-data-from-two-different-databases/ Share on other sites More sharing options...
AbydosGater Posted November 8, 2006 Share Posted November 8, 2006 just use<?PHP$conn = mysql_connect("localhost", "", "");mysql_select_db("thepdcom_popgallery", $conn) // connect to the database$dataONE = mysql_query("SELECT * FROM g2_user") //select all the informationmysql_select_db("thepdcom_popnew", $conn) //connect to new database$dataTWO = mysql_query("SELECT * FROM users") //select all the information//Now to match them put your matching code here?> Link to comment https://forums.phpfreaks.com/topic/26412-comparing-data-from-two-different-databases/#findComment-121550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.