<?PHP/*Add script parameter: u= user name v= city name Add City tag for user*/Header("content-type:text/html; Charset=utf-8 ");/*$server = "123.7.63.176"; Server IP address, if local, can be written as Localhost$uid = "NXTYJS"; User name $pwd = "[Email protected]#"; Password $database = "AAA"; MS Database name $conn =mssql_connect ($server, $uid, $pwd) or Die ("Connect Failed"); mssql_select_db ($database, $conn);*///Get pass Value$u=$_post[' U '];$v=$_post[' V '];/*//Display the user data in my to facilitate the addition of reference $a= $CNX->query ("SELECT * from Ofgroupuser"), foreach ($a as $b) {//print_r ($myrow);//echo "& Lt;br> "echo"-------------------------------------"echo" <br> "echo" OpenFire username >>>>> "; Var_dump ($b); Print_r ($a [' username '); echo "<br>"; echo "-------------------------------------";}*/$CNX=NewPDO ("Odbc:driver={sql Server}; Server=123.7.63.176;database=openfire; ", ' Nxtyjs ', ' [email protected]# ');//establish the first connection$a=$CNX->query ("SELECT * from Ofgroupuser");foreach($a as $b) { Echo"-------------------------------------";Echo"<br>";Echo"User name >>>>> in OpenFire";//Var_dump ($b);Print_r($b[' username ']);Echo"<br>";Echo"-------------------------------------"; }Echo"<br>";Echo"<br>";Echo"|||||||||||||||||||||||||||||||||||||||||||||| Add City Tags | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |;Echo"<br>";Echo"<br>";Echo"<br>";Echo"<form name= ' form ' method= ' post ' action= ' >";Echo"User: <input type= ' text ' name= ' U ' >";Echo" ";Echo"City tag: <input type= ' text ' name= ' V ' >";Echo" ";Echo"<input type= ' submit ' value= ' >";Echo"</form>";Echo"<br>";Echo"||||||||||||||||||||||||||||||| Expand the data in the database | | | | | | | | | | | | | | | | | | | | | | | |;Echo"<br>";Echo"<br>";//Print_r ($u);//print_r ($v);/*//Query the data $hang= the row of my keywords $result = mysql_query ("select * from Ofgroupuser where username like '". $u. "' ");//loop insert my row data and get value to Ms while ($row = Mysql_fetch_array ($hang)) {$query 123 = ' INSERT into Guanlian (uer,goup,visty) VALUES (n ' ". $row [' username ']." ', N ' ". $row [' GroupName ']." ', ' ". $v." ') "; $haha =mssql_query ($query 123); }*///Query MS Results$CNX=NewPDO ("Odbc:driver={sql Server}; server=123.7.63.176;database=aaa; ", ' Nxtyjs ', ' [email protected]# ');//Establish a second connection$row=$CNX->query ("SELECT * from Guanlian");foreach($row as $list){Echo"----------------------------------------------------------------------------------";Echo"<br>"; Echo"ID:"; Print_r($list[' ID ']); Echo"|"; Echo" "; Echo"User:"; Print_r($list[' Uer ']); Echo"|"; Echo" "; Echo"Group:"; Print_r($list[' Goup ']); Echo"|"; Echo" "; Echo"City:"; Print_r($list[' Visty ']); Echo"|"; Echo" "; Echo"<br>"; Echo"----------------------------------------------------------------------------------";Echo"<br>";}?>
One page PHP with multiple MS databases