Bug #18172 Updated: Mysql_query function RLIKE and REGEXP

From: Date: Mon, 08 Jul 2002 15:42:12 +0000
Subject: Bug #18172 Updated: Mysql_query function RLIKE and REGEXP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13532@lists.php.net to get a copy of this message
ID: 18172 Updated by: sander@php.net Reported By: r.denis@bell.ca -Status: Open +Status: Bogus Bug Type: MySQL related Operating System: Freebsd/Linux PHP Version: 4.2.1 New Comment: User error -> bogus Previous Comments: ------------------------------------------------------------------------ [2002-07-08 11:37:54] r.denis@bell.ca Sniper, I appreciate everyones help. I turns out that after carefully debugging /usr/local/libexec/apache/libphp4.so the regexp portion does not contain internal calls. It was indeed a small glitch in my code. the following line: //for ($i = 0; $i < mysql_num_fields($result2); $i++) { should have read: for ($i = 0; $i <= mysql_num_rows($result2); $i++ ) { OOPS! Because of the many facilities that php provides such as magic_quotes_* The use of additional functions such as pregquote is not required. I am shocked that nobody picked on the fact that some of the data was returned but not all of the data. The number of fields used in the database is 4 the number of records is the number of rows. Have a great day ------------------------------------------------------------------------ [2002-07-07 22:30:21] sniper@php.net let's keep this at 'feedback' status until we get the real feedback.. ------------------------------------------------------------------------ [2002-07-05 20:36:37] r.denis@bell.ca Sniper, I appreciate your assistance, The default install of FreeBSD turns on magic_quotes_* It is a nice addition in my opinion. It make things alot easier. Especially when you have peoples names like o\'brien It basically does all of the work for you. I will look into the problem more Tomorrow or Monday. However I do not see how preg_quote will have any bearing. Especially since it Magic quotes takes care of the work. instead of having robert.denis I would have "robert\.denis" This does not explain why it returns some but not all. Have a nice Weekend. Cheers, Robert ------------------------------------------------------------------------ [2002-07-05 15:46:09] sniper@php.net forgot to ask..do you have any of those magic_quotes_* directives set 'on' in php.ini? ------------------------------------------------------------------------ [2002-07-05 15:42:32] sniper@php.net Try doing this: $zcntlogin = preg_quote($zcntlogin); From mysql manual: "Note: Because MySQL uses the C escape syntax in strings (for example, \n'), you must double any \' that you use in your REGEXP strings" a dot '.' is special..so you have to escape it. If this didn't help either, please provide a SHORT but complete example script, max 5 lines, which does not work. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/18172 -- Edit this bug report at http://bugs.php.net/?id=18172&edit=1

« previous php.bugs (#13532) next »