Chapman Posted February 1, 2010 Report Share Posted February 1, 2010 if (isset($_POST['logout'])){ mssql_query ( "Use SecKeyPrior UPDATE S_Users SET Is_Connected = [b]???[/b] WHERE Nick = '$nick' " ); // izdzēš kūkijus setcookie("id", "", time()-3600); setcookie("Vards", "", time()-3600); setcookie("Uzvards", "", time()-3600); setcookie("Niks", "", time()-3600); setcookie("Admin", "", time()-3600); header("location: http://127.0.0.1"); } //pārmet uz sākumlapu if (isset($_POST['continue'])){ header("location: http://127.0.0.1"); } šis ir koda gabaliņs, kas tiek veikts, ja nospiež "IZIET" pogu! jautājums man ir par mssql bit datu tipu! cik saprotu, viņš mssql ir TRUE/FALSE datu tips, true ir, ja vērtiba ir 1, bet false, ja vertiba -1! ka uzlikt lai, lauka ieraksta -1 vertību? mēģināju dažādi, bet rezultātā tik nokāru apachi! Quote Link to comment Share on other sites More sharing options...
2easy Posted February 1, 2010 Report Share Posted February 1, 2010 bit ir 1/0 1 - true 0 - false Quote Link to comment Share on other sites More sharing options...
Chapman Posted February 1, 2010 Author Report Share Posted February 1, 2010 bit ir 1/0 1 - true 0 - false tad kāpēc veidojot tabulu, vins nelauj kā default vērtību to 0 likt? tikia -1 ļauj! Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2010 Report Share Posted February 1, 2010 No dokumentācijas: The BIT data type is used to store bit-field values. A type of BIT(M) allows for storage of M-bit values. M can range from 1 to 64. Līdz ar to, jāizvēlas 1 = true, 2=false, piemēram. 0 un negatīvi skaitļi netiek atbalstīti. Upps, atvainojos, nepareizi pateicu. cik no šī http://dev.mysql.com/doc/refman/5.1/en/bit-field-values.html sapratu, tad jāraksta kautkā šādi: lauks = b'0' vai lauks = b'1' UJ! Pilnīgs - sorry, tikai tikko pamanīju, ka runa ir par MSSQL. My bad. Quote Link to comment Share on other sites More sharing options...
2easy Posted February 1, 2010 Report Share Posted February 1, 2010 bit ir bit arī Āfrikā Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2010 Report Share Posted February 1, 2010 "In theory there is no difference between theory and praxis, in praxis... there is" ;) Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted February 1, 2010 Report Share Posted February 1, 2010 (edited) IMO true vinjsh ir gan ja veertiiba ir 1, gan -1, jo vinjsh nekur nesaglabaa ar kaadu ziimi vinjsh ir (vienaa bitaa tas vnk neielien). Taatad false vajadzeetu buut 0. Un skaties vai vinjsh ir uzlikts kaa NOT NULL - ja navl, tad tas vareetu izraisiit kaut kaadas probleemas. Edited February 1, 2010 by rATRIJS Quote Link to comment Share on other sites More sharing options...
2easy Posted February 1, 2010 Report Share Posted February 1, 2010 (edited) Aleksej nice izteicienu apmaiņa ^^ rATRIJ kodējot m$ pasaulē, visādi brīnumi dažkārt notiek test.vbs (parāda 2x msg box. tipa tas pats, kas js alert) MsgBox CInt(True) ' -1 MsgBox CInt(False) ' 0 Edited February 1, 2010 by 2easy Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted February 1, 2010 Report Share Posted February 1, 2010 Pieljauju, ka true ir randomaa - dazhreiz 1, dazhreiz -1 un uz vienu veertiibu iipashi paljauties nevareetu. Bet nu hvz - nekad taa iisti neesmu lietojis MS tehnologjijas :) nav nekas man pievilciigs. Quote Link to comment Share on other sites More sharing options...
2easy Posted February 1, 2010 Report Share Posted February 1, 2010 kad pierod, tad ir ok ;) katros džungļos ir savas bīstamās vietas. jāzin tik pareizā taciņa, lai izietu cauri ^^ Quote Link to comment Share on other sites More sharing options...
Chapman Posted February 1, 2010 Author Report Share Posted February 1, 2010 hm.... kā redzat, default value ir -1! un tabulaaa visur, kur tas ir, rāda False vērtības! ja uzlieku 1, tad ir true vertiba! Quote Link to comment Share on other sites More sharing options...
2easy Posted February 1, 2010 Report Share Posted February 1, 2010 nju tad raksti tajā sql vnk -1 Quote Link to comment Share on other sites More sharing options...
Chapman Posted February 1, 2010 Author Report Share Posted February 1, 2010 (edited) nju tad raksti tajā sql vnk -1 es jau tā daru, bet.... rezultātā tiek nokārta apache :( liec kādu vērtību gribi... :( mssql_query ( "Use SecKeyPrior UPDATE S_Users SET Is_Connected = '-1' WHERE Nick = '$nick' " ); izskatās, man kkas naw citur pareizi! jo pat es nevaru ierakstiit velreiz tur 1! iedošu jums pilno inex.php kodu: http://paste.php.lv/aaf9c0ed48ebed41f163fb6fc7337c57 maybe vins neatpaziist to $nick (11. rinda), jo tas tiek izveidots, kad nospiez ielogoshanas formu! Bet logout ir pieejams tikai tad, kad esmu ielogojies. vaitad man tas mainigasi $nick ir tad pazudis? Edited February 1, 2010 by Chapman Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 1, 2010 Report Share Posted February 1, 2010 hmm, bet kādēļ tev -1 ir pēdiņās? Vai nav tā, ka to nointerpretē kā teksta rindu? Quote Link to comment Share on other sites More sharing options...
briedis Posted February 1, 2010 Report Share Posted February 1, 2010 (edited) 0 vai 1 bez pēdiņām nevar? mssql_query ( "Use SecKeyPrior UPDATE S_Users SET Is_Connected = 1 WHERE Nick = '$nick' " ); MSSQLs vispār datu tipu ziņā ir šausmīgi piekasīgs :)) kad rakstīju tādu palielākus kvērijus, daudz nācās izmantot CAST funkciju... Edited February 1, 2010 by briedis 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.