Kikisss Posted August 27, 2009 Report Share Posted August 27, 2009 $class_query = $dbg[$_serv]->sql_query("SELECT `ClassName` FROM `char_templates` WHERE `ClassId`=". $subclass['char_id'] ); $class = $dbg[$_serv]->sql_fetchrow($class_query); $class = $class['ClassName']; Ошибка запроса (localhost, l2emu_db): SELECT `ClassName` FROM `char_templates` WHERE `ClassId`= 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 nesaprotu kas nav tā... Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted August 27, 2009 Report Share Posted August 27, 2009 Masīva elements: $subclass['char_id'] neeksistē vai ir vienāds ar '' Quote Link to comment Share on other sites More sharing options...
Web Developer Posted August 27, 2009 Report Share Posted August 27, 2009 Risinājums - pirms metodes izsaukšanas pārbaudīt vai mainīgais $subclass['char_id'] eksistē, vai tas ir skaitlis (virkni tur nevarēsi likt, ja nav pēdiņu) un vai atbilst nepieciešamajam intervālam (parasti - vai lielāks par 0). Quote Link to comment Share on other sites More sharing options...
Kikisss Posted August 27, 2009 Author Report Share Posted August 27, 2009 Risinājums - pirms metodes izsaukšanas pārbaudīt vai mainīgais $subclass['char_id'] eksistē, vai tas ir skaitlis (virkni tur nevarēsi likt, ja nav pēdiņu) un vai atbilst nepieciešamajam intervālam (parasti - vai lielāks par 0). Nekas neizdodas(nepārāk man padodas php)... Varbūt kāds varētu palīdzēt ar kodēšanu? Quote Link to comment Share on other sites More sharing options...
mickys Posted August 27, 2009 Report Share Posted August 27, 2009 (edited) if(isset(int()$subclass['char_id'])){ //daram to ko vajag } else{ //mirstam } Edited August 27, 2009 by mickys Quote Link to comment Share on other sites More sharing options...
Kikisss Posted August 27, 2009 Author Report Share Posted August 27, 2009 (edited) if(isset(int()$subclass['char_id'])){ //daram to ko vajag } else{ //mirstam } tas skripts itkā jau ir gatavs, bet man vaig izmainīt tabulas nosaukumus tajā vai ko citu. Ja kāds saprot kaut ko no DataLife Engine ta lūdzu atsaucaties... Edited August 27, 2009 by Kikisss Quote Link to comment Share on other sites More sharing options...
Web Developer Posted August 27, 2009 Report Share Posted August 27, 2009 Kikisss - tas ir tavs projekts, bezmaksas projekts vai arī projekts, par ko tev ir samaksāts vai sola samaksāt? Quote Link to comment Share on other sites More sharing options...
Kikisss Posted August 27, 2009 Author Report Share Posted August 27, 2009 Kikisss - tas ir tavs projekts, bezmaksas projekts vai arī projekts, par ko tev ir samaksāts vai sola samaksāt? mans projekts Quote Link to comment Share on other sites More sharing options...
Web Developer Posted August 27, 2009 Report Share Posted August 27, 2009 Ta tik cīnies. Izmēģini citus "engine" varbūt... 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.