march Posted January 23, 2006 Report Share Posted January 23, 2006 Kā panāk šādā kodā: $result = mysql_query("SELECT * FROM login WHERE password='$password' ") or die(mysql_error()); Lai mysql bez problēmām uztvertu mainīgo ($password) ? Tā kā ir tagad, visulaiku rodas problēmas Link to comment Share on other sites More sharing options...
hu_ha Posted January 23, 2006 Report Share Posted January 23, 2006 Tā kā ir tagad, visulaiku rodas problēmas Kurā brīdī tev rodas problēmas? Kas ir šīs problēmas? Kas šajā vaicājumā tevi neapmierina? Link to comment Share on other sites More sharing options...
march Posted January 23, 2006 Author Report Share Posted January 23, 2006 (edited) Problēma rodas tur ka mysql vajadzētu $password uztvert kā mainīgā vērtību, bet šādi rakstot vispār erroru neizmet un vienkārši tukšumu atgriež, bet rakstot bez ' ' rāda erroru: 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 2 Edited January 23, 2006 by march Link to comment Share on other sites More sharing options...
Vebers Posted January 23, 2006 Report Share Posted January 23, 2006 Ja atgriež tukšumu (NULL) , tad tāda parole tabulā nav atrasta. Link to comment Share on other sites More sharing options...
hu_ha Posted January 23, 2006 Report Share Posted January 23, 2006 Tad nākošais jautājums - kā tu tos datus izvadi, ja jau reiz kļūdu sql neatgriež.. Link to comment Share on other sites More sharing options...
march Posted January 23, 2006 Author Report Share Posted January 23, 2006 (edited) Kļūda bija pavisam kur citur - iepriekšējā lapā padeva mainīgo psw, a šinī lapā biju uzrakstījis lai saņem mainīgo pasw (Tas tas pats $password), līdz ar to jau mysql pieprasīju tukšumu, utt... Edited January 23, 2006 by march Link to comment Share on other sites More sharing options...
bubu Posted January 23, 2006 Report Share Posted January 23, 2006 error_reporting = E_ALL ? Link to comment Share on other sites More sharing options...
Agnisr Posted January 24, 2006 Report Share Posted January 24, 2006 [offtopic] Nezinu kāpēc, bet man nestrādā error_reporting, nu vienkārši, ja php kods ir kļūdains, parādās tukša lapa i vso, nekādu erroru or something like that. iekš php.ini error reporting = on un error_reporting= E_ALL Kur varētu slēpties problēma? Apnika stostīties pa kodu, koč kādu podskazku gribās, kurā rindā ir kļūda. P.S. Kur glabājas mysql log fails? Man kautko negrib izveidot datubāzi! drukāju mysql_query('Create database sviests'); Bet nekā, negrib veidot, pārbaudīju ar IF vai izveido, figu atgriež negatīvu rezultātu! Maybe nepareizi esmu kautko nokonfigurējis? Ak jā OS: Slackware Linux 10.2 mysql 4.1 php4 [/offtopic] Link to comment Share on other sites More sharing options...
Kristabs Posted January 24, 2006 Report Share Posted January 24, 2006 Agnisr 1) display_errors= On ? 2) mysql_query("kverijs")or die(mysql_error()); Link to comment Share on other sites More sharing options...
Agnisr Posted January 26, 2006 Report Share Posted January 26, 2006 1. Jā ir! Hmm kāds uz ātru roku nevar uzrakstīt vispār iesākumus MYSQL. Kā izveidot datubāzi, izdarīt ierakstus, izvilkt pēc tam datus ārā. OS: Slackware Linux 10.2, Mysql: 4.1 PHP:4 Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 26, 2006 Report Share Posted January 26, 2006 (edited) Sakars ar os tur nav.. http://dev.mysql.com/doc/refman/5.0/en/index.html te tak viss ir atrodams! Edited January 26, 2006 by Paulinjsh Link to comment Share on other sites More sharing options...
march Posted January 26, 2006 Author Report Share Posted January 26, 2006 es pēc šitā mācījos: http://www.tizag.com/mysqlTutorial/ Pēc manām domām vissaprotamākais tutoriālis Link to comment Share on other sites More sharing options...
Klez Posted January 26, 2006 Report Share Posted January 26, 2006 password nau gadiijumaa mysql rezerveetais vaards ?? pameegini itaa: $result = mysql_query("SELECT * FROM login WHERE `password`='$password' ") or die(mysql_error()); Link to comment Share on other sites More sharing options...
Recommended Posts