iall Posted June 5, 2007 Report Share Posted June 5, 2007 Esmu iesācējs tapēc lūdzams nekliegt! :) Lūk kods : Spied Kas tur nepareizs?Centos pats uzrakstīt :) Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Ar mysql_query vēl nepietiek. Pēc tam vēl vajag izpildīt, piem., mysql_fetch_assoc. Piemērus paskaties manuālī. Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 A tik tālu kods bija pareizs? :/ Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Nu sintakses kļūdu it kā nav. Kā arī es neredzu, kas darās iekš "n/cn_dbdefs.php", tā kā nevaru pateikt. Galu galā - pārbaudi taču pats. ;) PS. Kveriju izpildot ar mysql_query, nevajag nobeigt to ar kolu. PS2. Mainīgos bezjēgā nevajag likt pēdiņās. Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 (edited) Man viņš parādija kautko tādu = Resource id #3 ,kad pieliku beigās echo "$result"; Kad noņēmu nost tad vienkārši baltu lapu! Skriptu ņēmu no php.net majas lapas - Spied Edited June 5, 2007 by iall Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Nu bet es taču tev pateicu, kas tev vēl ir jāizdara! Link to comment Share on other sites More sharing options...
Val Posted June 5, 2007 Report Share Posted June 5, 2007 ietaupīsim Tev 2h meklēšanu: http://lv.php.net/mysql_fetch_row Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 Man sanāca šādi - Spied Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 12. rindiņā $result vietā liec $row. 13. rindiņā liec echo $row['subject']. Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\datafrom.php on line 12 aaah ,tas ir grūti! :/ Bet nekas ,es to izdarīšu :D Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Pēc mysql_query() ieliec echo mysql_error(). Tas tev pateiks, kas par kļūdu bija. Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 Bļin ,negrib teikt un jā ,man ir ieslēgts Error_Reporting :) Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Tam nevajadzētu error_reportingu ieslēgtu. PS. Es tagad tikai pamanīju - to 10o rindiņu izvāc vispār ārā. Link to comment Share on other sites More sharing options...
iall Posted June 5, 2007 Author Report Share Posted June 5, 2007 (edited) Izdevās 12 rindiņā otrā $row vietā ieliku $result!:) Es gribu savai mājas lapai uztaisīt "Nejaušs Raksts" iespēju ,ka no datubāzes tiek izvilkts raksts ,tikai nejaušs!Kā to es varētu izdarīt? :/ Edited June 5, 2007 by iall Link to comment Share on other sites More sharing options...
andrisp Posted June 5, 2007 Report Share Posted June 5, 2007 Kverijam piekabini galā ORDER BY RAND() LIMIT 1 Link to comment Share on other sites More sharing options...
Recommended Posts