gts Posted September 19, 2003 Report Share Posted September 19, 2003 Respektiivi fishka ir taada ka nekaadi nevaru iedabuut caur web based beckendu iekshaa MySQL baazee textu ja tas satur " ' ". Aizdomas kaapeec man ir bet noveerst nekaadi neizdodas. Mosh kaadam ir kaads labs padoms. Link to comment Share on other sites More sharing options...
Roze Posted September 19, 2003 Report Share Posted September 19, 2003 Vispaar jau php slasho kverijus pats.. bet ja nu kas.. Tieshi peec inserta vari ielikt rindinju echo mysql_errno() . ": " . mysql_error() . "\n"; tas preciizi paraadiis kas pa probleemu un ko mysql par to domaa.. http://lv.php.net/manual/en/function.mysql-error.php Otrs ir prieksh tekstiem izmantot addslashes() lai paarveidotu ' par \' http://lv.php.net/manual/en/function.addslashes.php Link to comment Share on other sites More sharing options...
laacz Posted September 22, 2003 Report Share Posted September 22, 2003 MySQL eskeipo tekstu tikai tad, ja ir magic_quotes_* vai kas nu tur ieksh php.ini iesetoti uz 'YES'. Es pats lietoju mysql_escape_string(); piem: mysql_query('INSERT INTO table (kaka) VALUES (' . mysql_escape_string($kaka) .')'); Link to comment Share on other sites More sharing options...
gts Posted September 22, 2003 Author Report Share Posted September 22, 2003 Thanks viiri Link to comment Share on other sites More sharing options...
Venom Posted September 23, 2003 Report Share Posted September 23, 2003 Tas bija tas, kāpēc man ne'patika vecās phpMyAdmin versijas - pašas nemācēja addslashot. Jānotestē arī, vai postējot no formām, netiek automatiski pievienoti tie \', citādi vajag ņemt tos nost, lai dabūtu oriģinālu textu: mysql_query("INSERT INTO table SET `value`='".mysql_escape_string(stripslashes($POST['incoming']))."'"); Link to comment Share on other sites More sharing options...
Roze Posted September 23, 2003 Report Share Posted September 23, 2003 nu pie posta by default (nokluseetajaa konfiguracijas variantaa) slashojas un par to atbild magic_quotes_gpc (jebshu Get Post Cookie) Link to comment Share on other sites More sharing options...
Recommended Posts