archux Posted February 28, 2007 Report Share Posted February 28, 2007 (edited) Labrīt! Tātad jau labu laiku taisu vienu portāliņu, bet tagad esmu satapies ar problemu! Taapeec prasiishu jums! Lieta taada izmantoju dbcount. Bet man vajag izdariit taa, lai vinjsh njem no datubazes A tabulas B ciparu 1 (no vairakam linijam), 1-niekus visus vinjsh nedriikst izvēlēties(taa man vajag) vinjam tie jaanjem taadi kaadus vinjsh atrod peec user_id kad tiek pieliidzinaats piemeeram $obj->link ! Aaa jaa gandriiz aizmirsu un tam, kad vinjsh skataas user_online ir jaabuttikai 1-niniekam iespējamam nulles, lai shis atmet :) Nu vovshem, tagad to kodā. Talak neko nedariiju: dbcount("(user_online)", "users", "1"); nu vo piemēram dbquery tas ir elementari, bet dbcount es nemāku jo to daru pirmoreizi :) Tapēc luudzu paliidzat! Te buus dbquery, varbuut peec taa vieglaak būs saprast! dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id=$obj->link AND user_online='1'"); Varbuut es kaut ko neta domaaju kaa jadara? Varbūt, var kautko vieglak? Vai cita tipa funkcija jāizmanto? (vai kā viņu tur sauc nu tip dbcount un dbquery utt) Un kas vē dbquery strādā tieši tā kā man vajag :) bet man visam tam vajag numurinju :) plzz paliidzat :) Edited February 28, 2007 by archux Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Kas vispār ir dbcount() ? Kas ir $obj->link ? Un tavs problēmas apraskts arī ir nesaprotams. Enīvei: SELECT * FROM `users` WHERE user_online = 1 AND user_id IN (1, 23, 34, 54) Ja tas $obj-link ir masīvs, tad ar explode palīdzību saveidojam user_id IN(bla, bla, bla). Link to comment Share on other sites More sharing options...
archux Posted February 28, 2007 Author Report Share Posted February 28, 2007 šis tas par to kas ir DBCOUNT()! Un man vinjsu ta4 vajag paraadiit kaa ciparu nevis kaa kautkādus izvlikumus tāpēc select nederēs man vajag. dbcount (un te viss raxtiits ta lai darbojaas)! dbcount is Link to comment Share on other sites More sharing options...
archux Posted February 28, 2007 Author Report Share Posted February 28, 2007 aa aizmirsu par to $obj<-likn tas ir no citas datu baazes bet vinjsh jaanoraada tapeec, lai piemeeram man neraadiitu tavus fovoritus. tipa ka njem tikai un vieniigi to da to :) Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Tu pats savus postus pārlasi ? Neko nevar saprast no tā, ko tu saki. Nevarēšu palīdzēt. Noformulē savu problēmu kārtīgi. Link to comment Share on other sites More sharing options...
archux Posted February 28, 2007 Author Report Share Posted February 28, 2007 (edited) nu kaa tas select dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id=$obj->link AND user_online='1'"); man ir jaadabuu taa kad vinju paraada ciparaa tagad saprati? un to var izdariit ar dbcount bet man kautkaa nesanaak jo nevarupareizi pabeigt rindu :( taapeec prasu varbuut ir veel kaadi varianti kaa to var izdariit Edited February 28, 2007 by archux Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Kādā ciparā ? Ko tas vispār nozīmē ? Link to comment Share on other sites More sharing options...
archux Posted February 28, 2007 Author Report Share Posted February 28, 2007 nu kaa vinjsh ar sho komandu no datu baazes izvelk araa kaut kaadus vertības no users datu bazes, tabulas user_online un man vajag taa, lai tur kur user_online vertibas ir 1 vins savāc visus userus un saskatia un paraada cik kopaa vinjsh atrada taadas sakritības ka user_online=1 Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 COUNT(*) Link to comment Share on other sites More sharing options...
divian Posted March 11, 2007 Report Share Posted March 11, 2007 SELECT user_id, COUNT(user_id) as juuzeri FROM ".$db_prefix."users WHERE user_online='1' ... echo "onlainaa".$row['juuzeri']; Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 Vienā kverijā šos abus nevar likt: user_id, COUNT(user_id) Link to comment Share on other sites More sharing options...
divian Posted March 11, 2007 Report Share Posted March 11, 2007 Vienā kverijā šos abus nevar likt: user_id, COUNT(user_id) :/ Kapēc ta nevar? Uztaisiju šitādu skriptiņ' kurā viss iet.. Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 Nu jā - ar GROUP BY viss ir štokos. Link to comment Share on other sites More sharing options...
Recommended Posts