[PHP-DB] how to explain such a regular syntax

2010-08-13 Thread win.a
Its was picked from drupal source code and i don't know how does it works. This is the code : preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host); After followed the regular syntax ,i try to cut it into pieces to make it simpler to understand , part a1: ^\[? part a2:([a-z0-9-:\]_]+\.?)+$ Then go

Re: [PHP-DB] how to explain such a regular syntax

2010-08-13 Thread Peter Lind
On 13 August 2010 08:47, win.a win@gmail.com wrote: Its was picked from drupal source code and i don't know how does it works. This is the code : preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host); This has got nothing to do with php or php-db - your question is on regular expressions. Try

[PHP-DB] COUNT() query help

2010-08-13 Thread Ron Piggott
I am making a Bible concordance. I need help with the query that figures out how many times each word is in the Bible. The COUNT() in the query below is giving me the total number of words for the letter of the alphabet, not the specific word, and is causing there to be only 1 search result. I

Re: [PHP-DB] COUNT() query help

2010-08-13 Thread Richard Quadling
On 13 August 2010 13:43, Ron Piggott ron.pigg...@actsministries.org wrote: SELECT `bible_concordance_words`.`reference`, `bible_concordance_words`.`word`, COUNT(`bible_concordance_word_reference`.`bible_concordance_words_reference`) AS occurrences FROM `bible_concordance_words` INNER JOIN