Blitz Posted October 6, 2005 Report Share Posted October 6, 2005 Nolasot stringu biezi paradas apastrofs ('), kad meiginu ielikt datu baazee, so stringu vins protams bliezh aaraa errorus... kaa var sito noverst. tp ar akut ko aizvietot lai db vinu normali ierakstitu... Link to comment Share on other sites More sharing options...
bubu Posted October 6, 2005 Report Share Posted October 6, 2005 http://lv.php.net/manual/en/function.mysql-escape-string.php Link to comment Share on other sites More sharing options...
Robis Posted October 6, 2005 Report Share Posted October 6, 2005 $BLITZA_STRINGI = "SELECT * FROM `string_table` WHERE `blitz`='as'es'es';"; $BLITZA_STRINGI = mysql_query(mysql_escape_string($BLITZA_STRINGI)); Link to comment Share on other sites More sharing options...
Blitz Posted October 6, 2005 Author Report Share Posted October 6, 2005 Nu jaa, bet interbase kaut ko lidzigu neatrodu.... tip man ir faila nosaukums 6545665-'65.JPG un man vinu vajag ievietot ieksaa ar INSERT. Neder tas ka ' vispar pazudiis... pilnam faila nosaukumam, lai nu kads vins ir, ir jaatrodas db... Kaa sito var dabut gatavu? Link to comment Share on other sites More sharing options...
Klez Posted October 6, 2005 Report Share Posted October 6, 2005 nesaglabaa faila nosaukumos ' <-- to simbolu un dziive buus tew wieglaaka, vai arii glabaa mysql`aa ar viesiem '. stripslashes adslashes pasties itaas divas fcijas manuaalii Link to comment Share on other sites More sharing options...
Blitz Posted October 6, 2005 Author Report Share Posted October 6, 2005 mjaa... tas pamatigi iegriezh... bet paldies... Link to comment Share on other sites More sharing options...
bubu Posted October 6, 2005 Report Share Posted October 6, 2005 Ak dievs... viens koments par otru stulbāks... Robi tu jocīgs esi? visu kveriju eskeipot? Un kāds labums no tā, ja mysql redzēs: SELECT * FROM `string_table` WHERE `blitz`=\'as\'es\'es\'; ? Vajag tikai DATUS eskepot (tb to as'es'es tikai) Klez: kas pa muļķībām - kur problēmas ' faila nosaukumā lietot? Link to comment Share on other sites More sharing options...
Klez Posted October 6, 2005 Report Share Posted October 6, 2005 Klez: kas pa muļķībām - kur problēmas ' faila nosaukumā lietot? 24178[/snapback] Es jau nesaku ka ir probleemas. Vienk lai cilveeks paskataas taas fcijas, ja vinsh eskaipos stringu un ieliks mysql`aa, bet kad selektees, tad vinjam buuus \' bet faila nosaukumaa buus ' , respektiivi kad no mysql panjem, tad vaig \ novaakt, lai paliek tikai ' . Link to comment Share on other sites More sharing options...
bubu Posted October 6, 2005 Report Share Posted October 6, 2005 wtf? Kas tās par muļķībām, ko tu stāsti? \' no mysql iznāks tikai tādā gadījumā, ja būs divas reizes eskeipos! (kāda jēga? nezinu - nav jēgas) Ja vienu reizi (kā to normāli cilvēki dara) eskeipos, tad nekāds \' nenāks, bet normāls ' nāks. Link to comment Share on other sites More sharing options...
Blitz Posted October 7, 2005 Author Report Share Posted October 7, 2005 tatad ar interbase es to tapat nevaru izdarit, ja? kaut ko lidzigu escape_string manuali vismaz neredzu... Link to comment Share on other sites More sharing options...
v3rb0 Posted October 7, 2005 Report Share Posted October 7, 2005 kads sakars peedinju aizvietosanai stringaa ar izmantoto datubaazi? reku // no manualjaa.. if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; } // un taalaak saavaa sqlaa raksti kur un kaa gribi $sql = 'insert into asd(dsa) values ("'.$lastname.'")'; Link to comment Share on other sites More sharing options...
bubu Posted October 7, 2005 Report Share Posted October 7, 2005 tatad ar interbase es to tapat nevaru izdarit, ja? kaut ko lidzigu escape_string manuali vismaz neredzu... 24196[/snapback] Iemācies manuāli lietot (See Also sadaļu). http://lv.php.net/manual/en/function.addslashes.php Link to comment Share on other sites More sharing options...
Klez Posted October 8, 2005 Report Share Posted October 8, 2005 (edited) ja daudz maz jauns php ira tad vinsh automaatiski eskaipo ... magic_qotes vai kaa tur saucas. Nu jaa. bet jaunajam jau ir iesleegts bu default. :) Edited October 8, 2005 by Klez Link to comment Share on other sites More sharing options...
bubu Posted October 8, 2005 Report Share Posted October 8, 2005 Kāpēc daudzmaz jauns? Tak arī vecākiem php var ieslēgt tās jocīgās magic_quotes. Link to comment Share on other sites More sharing options...
Recommended Posts