Cheers
Search found 11 matches
- Mon Sep 11, 2006 4:38 am
- Forum: Databases
- Topic: count in multiple tables
- Replies: 4
- Views: 777
- Mon Sep 11, 2006 4:37 am
- Forum: Databases
- Topic: Postgres GROUP BY
- Replies: 1
- Views: 435
Postgres GROUP BY
Hi! I'm puling out photos depending on category entered with following code SELECT DISTINCT ON(challid) photoid, filename, challid, rating FROM excel_gallery WHERE active > 0 $adultsql AND category = '$searchcat' but with DISTINCT ON I have no control on rows selected as the query pulls just lates r...
- Fri Sep 08, 2006 9:08 am
- Forum: Databases
- Topic: count in multiple tables
- Replies: 4
- Views: 777
- Fri Sep 08, 2006 3:52 am
- Forum: Databases
- Topic: count in multiple tables
- Replies: 4
- Views: 777
count in multiple tables
SELECT DISTINCT ON (qid)qid, aid, rank(idxfti, to_tsquery('$searchphrase'),2) AS score FROM forumquestions WHERE idxfti @@ to_tsquery('$searchphrase') AND catid != '33' AND status = '1' UNION SELECT DISTINCT ON (qid) qid, aid, rank(idxfti, to_tsquery('$searchphrase'),2) AS score FROM forumanswers W...
- Wed Aug 16, 2006 7:48 am
- Forum: Databases
- Topic: distinct and order by trouble
- Replies: 4
- Views: 378
- Wed Aug 16, 2006 7:02 am
- Forum: Databases
- Topic: distinct and order by trouble
- Replies: 4
- Views: 378
what sql have you got at the moment? Tried loads but didn't find how to do it. Atm I it works for me with SELECTing DISTINCT challid, insterting them to array and then doing foreach for that array and SELECTING particular photoid ORDERED BY rating LIMIT 1. That first query is LIMIT 16 so it's not s...
- Wed Aug 16, 2006 6:33 am
- Forum: Databases
- Topic: distinct and order by trouble
- Replies: 4
- Views: 378
distinct and order by trouble
Hi!
I've got those collumns in PG database to work with - photoid, filename, challid, rating.
What's the query to get unique(distinct) challid and results ordered by rating? Can't figure it out. I need to fetch all given collumns as well.
Thanks for any hints
Cheers
Tom
I've got those collumns in PG database to work with - photoid, filename, challid, rating.
What's the query to get unique(distinct) challid and results ordered by rating? Can't figure it out. I need to fetch all given collumns as well.
Thanks for any hints
Cheers
Tom
- Fri Aug 11, 2006 6:05 am
- Forum: PHP - Security
- Topic: Efficient banning system
- Replies: 8
- Views: 3804
- Fri Aug 11, 2006 5:14 am
- Forum: PHP - Security
- Topic: Efficient banning system
- Replies: 8
- Views: 3804
- Fri Aug 11, 2006 5:00 am
- Forum: PHP - Security
- Topic: Efficient banning system
- Replies: 8
- Views: 3804
Efficient banning system
Hi all, I have trouble with one of the ex-users of our site. He is changing IPs, passwords, names and emails and re-registers all the time. Is there a way how to make banning more efficient? Is there a way how to read e.g. his MAC address and use it in PHP script? Any hints much appreciated! Cheers ...
- Wed Aug 02, 2006 11:52 am
- Forum: PHP - Code
- Topic: Inline editing
- Replies: 8
- Views: 451
ajax
I'd use prototype AJAX framework for calling remote script and saving. Or you can write it from the ground if you can. I use scriptaculous for in line editing - see how easy it is <script type="text/javascript"> new Ajax.InPlaceEditor('editme1', '/updateprofile.php?edit1'); </script> and r...