snach15 Posted December 27, 2010 Report Share Posted December 27, 2010 kā lai pievieno vēlvienu tādu pasu query tikai lai nolasa no citas tabulas .. piemēram $query = mssql_query("SELECT top 100 Name FROM DB2"); šim scriptam .. $query = mssql_query("SELECT top 100 Name FROM DB1"); while($abc = mssql_fetch_array($query)){ echo $abc[Name]; } ja es iegš tā while ielieku vēlvienu while tad darbojas tikai viens .. bet ja uztaisīt divus kvērijus un katrs lasa no savas datubāzes tad atkal darbojas tikai viens .. bet man vajg lai darbojas abi ... nekādīgi nevaru izdomāt kā lai to panāku .. manā gadījumā while ir obligāts .. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 27, 2010 Report Share Posted December 27, 2010 No citas db vai no citas tabulas? Ja otrais, tad JOIN. Quote Link to comment Share on other sites More sharing options...
snach15 Posted December 27, 2010 Author Report Share Posted December 27, 2010 (edited) tabulas tabulas .. piedošanu ... varētu nelielu piemēru par to JOIN ? kautkā neizprotu Edited December 27, 2010 by snach15 Quote Link to comment Share on other sites More sharing options...
Rincewind Posted December 27, 2010 Report Share Posted December 27, 2010 SELECT top 100 Name FROM DB1 UNION SELECT top 100 Name FROM DB2 Quote Link to comment Share on other sites More sharing options...
snach15 Posted December 27, 2010 Author Report Share Posted December 27, 2010 (edited) tabulas tabulas .. piedošanu ... varētu nelielu piemēru par to JOIN ? kautkā neizprotu pēc šīs metodes uztaisīju .... rezultātā Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'GrandReset'. (severity 16) in C:\WWW\htdocs\0.2\modules\rank.php on line 53 Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'Reset'. (severity 16) in C:\WWW\htdocs\0.2\modules\rank.php on line 53 Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'cLevel'. (severity 16) in C:\WWW\htdocs\0.2\modules\rank.php on line 53 Warning: mssql_query() [function.mssql-query]: Query failed in C:\WWW\htdocs\0.2\modules\rank.php on line 53 Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\WWW\htdocs\0.2\modules\rank.php on line 58 53 rindiņa $query = mssql_query("SELECT top 100 premium FROM MEMB_INFO UNION SELECT top 100 mu_id,Name,Class,cLevel,Reset,GrandReset,CtlCode FROM Character order by GrandReset desc,Reset desc,cLevel desc"); 58 rindiņa while($adder = mssql_fetch_array($query)){ visas colonas tādas man ir... Edited December 27, 2010 by snach15 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.