djmartins Posted May 17, 2008 Report Share Posted May 17, 2008 Tātad saglabājot informāciju db izmet šādu erroru, Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource kaut gan visa informācija tiek nosūtīta uz db. Cik nprotu tad problēma ir šeit: $result = mysql_query("SELECT * FROM filmu_apraksti;", $connect); while ($res = mysql_fetch_array($result)) { $res[0]; $result = mysql_query("INSERT INTO komentari (dtime, niks, komentars, filmu_id) VALUES ('$NOW()','$niks','$komentars','$res[0]')",$connect); } Kā lai to erroru aizvācu prom? Link to comment Share on other sites More sharing options...
bubu Posted May 17, 2008 Report Share Posted May 17, 2008 Kas tas par '$NOW()' ? Nav tur nekādiem simboliem $ un ' jābūt. Ja nezini vai kverijs ir valīds - tad izvadi to ar echo un iekopē mysql klientā pa tiešo. Link to comment Share on other sites More sharing options...
anonīms Posted May 17, 2008 Report Share Posted May 17, 2008 Vaina ir šajā rindā $result = mysql_query("SELECT * FROM filmu_apraksti;", $connect); kur? nezinu. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 18, 2008 Report Share Posted May 18, 2008 muljkiibas ... vaina ir sheit : $res[0]; --> kas taas taads ??? un sheit: (kaa jau bubu noraadija ) ( '$NOW()', --> ( 'NOW() ' Bez $ Kaa arii sheit komentars','$res[0]')", --> komentars','{$res[0]}')", vai komentars','".$res[0]."')", ------ Link to comment Share on other sites More sharing options...
andrisp Posted May 18, 2008 Report Share Posted May 18, 2008 Nē nu vispār jau kļūda ir par mysql_fetch_array(). Vienīgais, ko varu iedomāties - nav tādas tabulas. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 18, 2008 Report Share Posted May 18, 2008 andrisp --> parlasiju topiku... Jaa tev taisniiba :) Vel varbutiiba ka Nav piekonekteets pie DB ... Bet tas ko noraadiju arii ir speekaa ;) Link to comment Share on other sites More sharing options...
bubu Posted May 18, 2008 Report Share Posted May 18, 2008 Nav ko daudz zīlēt: $result = mysql_query("SELECT * FROM filmu_apraksti;", $connect) or die(mysql_error()); Link to comment Share on other sites More sharing options...
djmartins Posted May 18, 2008 Author Report Share Posted May 18, 2008 izmēģināju jūsu priekšlikumus taču diemžēl nekas nemainijās. Kā error meta ārā tā vēl joprojām met. Link to comment Share on other sites More sharing options...
andrisp Posted May 18, 2008 Report Share Posted May 18, 2008 Ko tev mysql_error() izdrukāja ? Un varbūt vispār vaina ir citur kodā, nevis tajā daļā, ko tu te esi iekopējis ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 18, 2008 Report Share Posted May 18, 2008 ieliec : echo $connect; un paskaties ko vinsh uzrada .. vai vispar taa ir SQL konekcija ... Link to comment Share on other sites More sharing options...
mounkuls Posted May 18, 2008 Report Share Posted May 18, 2008 (edited) Konekcija ir man liekas, ja jau Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Nu man sanāk 4 kļūdas vienā rindiņā $result = mysql_query("INSERT INTO komentari (dtime, niks, komentars, filmu_id) VALUES ('$NOW()','$niks','$komentars','$res[0]')",$connect); Vajadzētu šādi būt OK $result = mysql_query("INSERT INTO komentari (dtime, niks, komentars, filmu_id) VALUES (NOW(),'$niks','$komentars','".$res[0]."');",$connect); Un par to pliko $res[0]; ar nav skaidrs. Edited May 18, 2008 by mounkuls Link to comment Share on other sites More sharing options...
Recommended Posts