Jump to content
php.lv forumi

while + query


snach15

Recommended Posts

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 ..

Link to comment
Share on other sites

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 by snach15
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...