Grey_Wolf Posted September 30, 2005 Report Share Posted September 30, 2005 $query="UPDATE `tabula` SET `bla` = 1 WHERE `id`=1 LIMIT 1"; $result= mysql_query($query) probleema ir shada ja tabulaa ir teiksim 5 ieraksti Id 1,2,3,4,5 tad dotais kods atgriezj $result=true Tik taal vis ir OK. bet arii ja id=20 tad tiek atgriezts true !! kaa lai paarbauda ka dotais pieprasijums nav/nevar tikt izpildiits ------ P.S. taa jau arii sanaak no sql sintakses - jo querijs ir valiids .... Link to comment Share on other sites More sharing options...
Analgiins Posted September 30, 2005 Report Share Posted September 30, 2005 nu mosh paarbaudi ar identical: if ($result !== false) prieksh update vaicaajumiem paarbaudei var izmantot mysql_affected_rows() Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 30, 2005 Author Report Share Posted September 30, 2005 (edited) nu mosh paarbaudi ar identical: if ($result !== false)prieksh update vaicaajumiem paarbaudei var izmantot mysql_affected_rows() 23502[/snapback] "if ($result !== false)" izlasi ruupiigaak probleemu... Vinsh vienmeer atgriezj true :( un protams peec tam jau parbaude ir tieshi taada.... mysql_affected_rows() - sho paapeetiishu paldies... edit: mysqli_affected_rows() - tikai PHP5 :( neder jo uz servera ir PHP 4.xxx sory: mysql_affected_rows() - bez i :( - straadaa - vismaz parliecinaas par izpildi..... Edited September 30, 2005 by Grey_Wolf Link to comment Share on other sites More sharing options...
bubu Posted September 30, 2005 Report Share Posted September 30, 2005 Lasi helpu: (http://lv.php.net/manual/en/function.mysql-query.php) For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error Tātad false būs tikai kļūdas gadījumā, tb kad tev būs nekorekta SQL teikuma sintakse. Bet updeitojot tabulu, kur WHERE nosacījums neizpildās nevienam ierakstam - tā jau nekāda kļūda. Nejauc semantiku ar sintaksi. Link to comment Share on other sites More sharing options...
hmnc Posted September 30, 2005 Report Share Posted September 30, 2005 affected rows standartā tak ir :) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 30, 2005 Author Report Share Posted September 30, 2005 Bet updeitojot tabulu, kur WHERE nosacījums neizpildās nevienam ierakstam - tā jau nekāda kļūda. Nejauc semantiku ar sintaksi. 23513[/snapback] es nejaucu :) ----- atkartojos: kaa lai paarbauda ka dotais pieprasijums nav/nevar tikt izpildiits -------- jautaajums bija tieshi taads kaa lai parbauda vai ir izpildiits - res. vai tam ir jeega :) --- un probleemu atrisinaaju ar mysql_affected_rows(). ------- paldies par paliidziibu :) P.S. lugums tomeer izlasiit jautaajumu Link to comment Share on other sites More sharing options...
rpr Posted September 30, 2005 Report Share Posted September 30, 2005 edit: mysqli_affected_rows() - tikai PHP5 :(neder jo uz servera ir PHP 4.xxx muljkjiibas, shii funkcija ir arii 4. un manupraat pat veel pirms tam bija. Link to comment Share on other sites More sharing options...
Analgiins Posted September 30, 2005 Report Share Posted September 30, 2005 lasam manuaali: http://lv.php.net/manual/en/function.mysql-affected-rows.php mysql_affected_rows (PHP 3, PHP 4, PHP 5) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 30, 2005 Author Report Share Posted September 30, 2005 lasam manuaali: http://lv.php.net/manual/en/function.mysql-affected-rows.phpmysql_affected_rows (PHP 3, PHP 4, PHP 5) 23523[/snapback] Mjaa galvenais laikam ir vismaz kautko ieposteet :( varbuut var izlasiit arii iepriekseejos postus? Es jau rakstiju ka PALDIES PROBLEEMA JAU IR ATRISINAATA sleegts Link to comment Share on other sites More sharing options...
Recommended Posts