IM24LV Posted February 20, 2008 Report Share Posted February 20, 2008 $tests = dbcount("(user)", "konkurss", "user='".$userdata['user_id']."'"); if (!$tests) { content} tipa kodam ir jāpārbauda vai konkrētais lietotājs nav jau pieregjistreejies konkursam, un ja nav, tad jaaparaada tas kas paraadaams. es ar vienu cilvekeu jau itkaa patesteeju, itkaa straadaa shaaads variants, bet tomeer ir aizdomas, ka tas nav tas pareizaakais :) Vai tā ir? Vai arī nav? Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 dbcount - tas i kas? :) Link to comment Share on other sites More sharing options...
Val Posted February 20, 2008 Report Share Posted February 20, 2008 moš kristāla bumbas funkcija? Link to comment Share on other sites More sharing options...
IM24LV Posted February 20, 2008 Author Report Share Posted February 20, 2008 hmm, ok, pats noskaidrošu kas ir ar to funkciju, laikam tā ir kkur nodefinēta CMSā :D a man likās, ka tā ir oficiāla... bet nu tā ir tipa saskaitīšana, user ir lauks no kura atlasa un skatās vai nesakrīt ar ielogojušā usera ID, un konkurss ir pats tabulas nosaukums. es nemaz nezinu kā to varētu savādāk uzrakstīt :shame: :) Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 SELECT COUNT(id) AS skaits FROM usertable WHERE id= XXX Ja ir tāds lietotājs, tad skaits == 1, ja nav, tad skaits == 0 Link to comment Share on other sites More sharing options...
Pentiums Posted February 21, 2008 Report Share Posted February 21, 2008 tas dbcount() laikam bija iekš php-fūzijas Link to comment Share on other sites More sharing options...
Recommended Posts