Jump to content
php.lv forumi

mssql_query reizinasana ar kadu noteiktu vertibu


K2Master

Recommended Posts

Tātad problēma sekojoša. Mainīgajiem piešķirtas vērtības

 

$grandi_ = mssql_query("Select gr_count from Character where name='. $char_set .'");

$grandis = mssql_fetch_row($grandi_);

$grandi = $grandis + 1;

$gr_str1 = 1000;

$GR_DS[0] = $gr_str1 * $grandi;

$gr_agi1 = 1000;

$GR_DS[1] = $gr_agi1 * $grandi;

$gr_vit1 = 1000;

$GR_DS[2] = $gr_vit1 * $grandi;

$gr_ene1 = 1000;

$GR_DS[3] = $gr_ene1 * $grandi;

$gr_com1 = 1000;

$GR_DS[4] = $gr_com1 * $grandi;

 

Bet kods man lasa pozīciju tabula. Bet man vajag lai attiecīgās šūnas satura skaitlis būtu $grandis . Nocīnijies esmu jau visu dienu. Bet rezultāts 0 :(

Varbū kāds var palīdzēt. Paldies jau iepriekš.

Edited by K2Master
Link to comment
Share on other sites

Tajā tevis iedotajā rindiņā šāds error.

Warning: mssql_result() [function.mssql-result]: Bad row offset (0)

 

Itkā strādā ar šādu risinājumu, tikai nezinu cik droši tādu koda mučkuli taisīt un cik daudz tur lieks tajā visā ko var izravēt ārā.

 

$gr_str1 = 1000;
$gr_agi1 = 1000;
$gr_vit1 = 1000;
$gr_ene1 = 1000;
$gr_com1 = 1000;

$mmm = "Select Name,Class,cLevel,Reset,AccountID,gr_count from Character where Name='". $char_set ."' order by gr_count desc, reset desc, clevel desc";
$grands = @mssql_query($mmm);
$grandis = mssql_fetch_row($grands);
$grandi = $grandis[5] + 1;
$GR_DS[0] = $gr_str1 * $grandi;
$GR_DS[1] = $gr_agi1 * $grandi;
$GR_DS[2] = $gr_vit1 * $grandi;
$GR_DS[3] = $gr_ene1 * $grandi;
$GR_DS[4] = $gr_com1 * $grandi;

Link to comment
Share on other sites

Kas par murgu? Saproti, ja Tu saglabā mainīgajā datus pa tiešo no datubāzes, ar viņiem nevar rīkoties. Vajag darīt šādi...

 

$data = mysql_result( mysql_query( $sql ), 0 );

 

...vai fn mysql_fetch_row().

 

 

Vai arī Tev ir MS SQL? Es eju svinēt.

Edited by daGrevis
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...