Trakais20 Posted September 27, 2007 Report Share Posted September 27, 2007 (edited) Sveiki esmu ustaisijis mazinu web un tad gribeju ustaisit ka katrs lietotajs var izveleties kadu stilu vins grib izmantot no dotajiem paraugiem tatad problema ir tada ka cods darbojas bet ir viena problema kad nesi ielogojies stils darbojas bez problemam kad jau esi ielogojies stils ari darbojas to ko tu esi izvelejies bet uz vienu reizi ielogojos ka lietotajs stils darbojas uspiezu sakums vai nospiezu F5 vins uzreiz nonem visus stilus un uzmet sadu error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\www\index.php on line 146 plz palidziet atrisinat so broblemu Cerams ka sapratisiet ko es gribu dabut gatavu reku kodins http://paste.php.lv/6153 EDIT: Vins nak no Datu bazes ja es pareizi sapratu tavu autajumu Edited September 27, 2007 by Trakais20 Link to comment Share on other sites More sharing options...
andrisp Posted September 27, 2007 Report Share Posted September 27, 2007 No kurienes nāk $niks mainīgais ? PS. Komatiņus, lūdzu... Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2007 Report Share Posted September 27, 2007 Problema ir šaja SQL vaicajuma : SELECT st FROM lietotaaji WHERE niks = $niks Niks droši vien ir string tpc vaig viņu ielikt iekš niks = '$niks' , protams ja tads lietotajs eksiste. Link to comment Share on other sites More sharing options...
Trakais20 Posted September 27, 2007 Author Report Share Posted September 27, 2007 (edited) reku vis index.php kods ta vai jums vieglak saprast kas man ir un kas nav jo es isti vel nezinu PHP jo vel tikaj macos citigi taisot savu WEB kodam var teikt pasa auksa ir jau minets par string http://paste.php.lv/6152 Edited September 27, 2007 by Trakais20 Link to comment Share on other sites More sharing options...
andrisp Posted September 27, 2007 Report Share Posted September 27, 2007 A tu izdarīji, ko MakaTaNaw teica ? Link to comment Share on other sites More sharing options...
Trakais20 Posted September 27, 2007 Author Report Share Posted September 27, 2007 (edited) kad es macijos pec viena tutoriala tad bija skriptins vai automatiski liek string http://paste.php.lv/6152 Edited September 27, 2007 by Trakais20 Link to comment Share on other sites More sharing options...
andrisp Posted September 27, 2007 Report Share Posted September 27, 2007 (edited) Par ko tu runā ? UPD: Sapratu.. Tas $niks tiek definēts tikai pie ielogošanās. Tāpēc jau arī kversijs neworko pēc tam. Liec to $niks iekš sesijas masīva un izmanto to. Edited September 27, 2007 by andrisp Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2007 Report Share Posted September 27, 2007 (edited) Trakais20 es nerunāju par pašu PHP, to es zinu, ka viņš pats automātiski konvertē datu tipus (string, int, utt). Runa iet par pašu query. Vai tiešām viss ar karoti mutē jābāž ? SELECT st FROM lietotaaji WHERE niks = '$niks' UPD: sorry, paskatījos tavā skriptā. Tur viss it kā okey, bet debugo to skriptu. Ik pa laikam paskaties kāds izskatās query utt. Piemēram: echo "SELECT st FROM lietotaaji WHERE niks = $niks"; Edited September 27, 2007 by MakaTaNaw Link to comment Share on other sites More sharing options...
andrisp Posted September 27, 2007 Report Share Posted September 27, 2007 MakaTaNaw, viņam pēdiņas tiek pieliktas pirms tam jau. Link to comment Share on other sites More sharing options...
Trakais20 Posted September 27, 2007 Author Report Share Posted September 27, 2007 (edited) so kludu es dabuju nost Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\www\index.php on line 146 aizmirsu pielikt $niks = quote_smart(htmlspecialchars($_POST['niks'])); bet galvena problema man vel jo projam ir kad ielogojas tad parada stilu kad uspiez F5 vins nonem stilu zinu to ka vins stilu parada vienreiz kludu ir kautkur set http://paste.php.lv/6153 Edited September 27, 2007 by Trakais20 Link to comment Share on other sites More sharing options...
andrisp Posted September 27, 2007 Report Share Posted September 27, 2007 Izlasi vēlreiz #7 postu. Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2007 Report Share Posted September 27, 2007 Kā arī pazūd visi $_POST mainīgie kā piemēram $_POST['st'] Link to comment Share on other sites More sharing options...
Trakais20 Posted September 27, 2007 Author Report Share Posted September 27, 2007 (edited) pirms refresh 1. bilde SELECT st FROM lietotaaji WHERE niks = 'Trakais' pec refresh 2. bilde SELECT st FROM lietotaaji WHERE niks = Edited September 27, 2007 by Trakais20 Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2007 Report Share Posted September 27, 2007 Ka jau es teicu pēc refresh pazūd visi post mainīgie! paskaties var_dump($_POST), un ko tu redzi pēc refresha? Neko! ;) Link to comment Share on other sites More sharing options...
Trakais20 Posted September 27, 2007 Author Report Share Posted September 27, 2007 ja pareizi ieluku tad man paradija sita SELECT st FROM lietotaaji WHERE niks = NULL Link to comment Share on other sites More sharing options...
Recommended Posts