Search found 10 matches

by kwong
Tue Jun 24, 2008 1:45 am
Forum: Databases
Topic: MySQL CONCAT Syntax
Replies: 4
Views: 1560

Re: MySQL CONCAT Syntax

Thanks heaps onion2k,
I know there must be a syntax, Thank for pointing me out.

Cheers

Kal
by kwong
Mon Jun 23, 2008 2:01 pm
Forum: Databases
Topic: MySQL CONCAT Syntax
Replies: 4
Views: 1560

Re: MySQL CONCAT Syntax

I mean the latter, I'd like to get all id in a table concatenated by ",".
Is that possible?

thanks for your answer :D
by kwong
Mon Jun 23, 2008 1:55 pm
Forum: Databases
Topic: MySQL CONCAT Syntax
Replies: 4
Views: 1560

MySQL CONCAT Syntax

Hello everyone, I need help in constructing mysql query syntax. Suppose I have a table with auto increment id as primary key. What is the syntax to query all id and result in 1,2,3,4,5,6,7,8,9,... I tried to use CONCAT_WS(",", id) but it doesn't do. Any suggestion? thanks for any answer. :P
by kwong
Thu Mar 13, 2008 6:08 pm
Forum: PHP - Code
Topic: socket_getpeername()
Replies: 3
Views: 901

Re: socket_getpeername()

Modred, thanks for your answer. In fact, it has triggered another question which sounds like this: "If we can't know for sure our visitor IP address, how would it be possible to distinguish one visitor and another?" "How do we know that it is Visitor A who connects again regardless th...
by kwong
Wed Mar 12, 2008 8:59 pm
Forum: PHP - Code
Topic: socket_getpeername()
Replies: 3
Views: 901

socket_getpeername()

Hi all, I'm currently digging into socket programming and found this function call socket_getpeername() http://au2.php.net/manual/en/function.socket-getpeername.php It retrieves the host ip address and port. I'm not sure if this is the server port and ip or the client's. Is there a function that we ...
by kwong
Thu Mar 15, 2007 5:46 pm
Forum: Regex
Topic: Password validation with regex
Replies: 9
Views: 2319

Thanks everyone, I've got no time, I submitted my work last nite, I ended up with 3 regex. Here how I did it $pattern = "/^[1-5][(1-5[]*$)]{4,14}[1-5]$/"; $pattern2 = "/[*]+/"; $pattern3 = "/[$]+/"; if(preg_match($pattern, $message)){ if(preg_match_all($pattern2, $messa...
by kwong
Thu Mar 15, 2007 9:45 am
Forum: Regex
Topic: Password validation with regex
Replies: 9
Views: 2319

Thanks stereofrog, Your pattern matches my third example, however it didn't match 1**$$1 (this one should pass, but using your pattern it fails). anyway I notice the ?= in your pattern and look like you define what it is later in a separate sub condition. I have an idea, I will try it and see if it ...
by kwong
Thu Mar 15, 2007 8:46 am
Forum: Regex
Topic: Password validation with regex
Replies: 9
Views: 2319

The condition is min 6 characters and maximum 16, first and last character must be numbers between 1-5, must contains at least one * and one $, permittable characters: alpha and number 1-5. Feyd, here are pass and fail example(min 6 characters): "111111" should fail-> no * and $ "1234...
by kwong
Thu Mar 15, 2007 6:26 am
Forum: Regex
Topic: Password validation with regex
Replies: 9
Views: 2319

Thank you Kieran, however when I apply your pattern and test it with 111111, it returns true, it's supposed to return false.
by kwong
Thu Mar 15, 2007 1:41 am
Forum: Regex
Topic: Password validation with regex
Replies: 9
Views: 2319

Password validation with regex

Hi All, I'm not a new member actually, join this forum last year but being passive all time, for some reason I can't login even though I have requested a new password. Okay. get to the point. this is my pattern : $pattern = "/^[1-5]([1-5[:alpha:]\*\$){4,14}[1-5]$/"; I need to check a passw...