I'm trying to make a small and simple search function, but it only works for
exact searches, and I can't figure out how to make a wildcard search, if I
do it in the php or in the mysql_query, can't really find anything about it
and I don't know what to look for on php.net
Håkan
--
PHP General
That's because this is a MySQL-specific question and you should be reading
the MySQL documentation or asking on the MySQL list.
-Rasmus
On Mon, 11 Nov 2002, Håkan wrote:
I'm trying to make a small and simple search function, but it only works for
exact searches, and I can't figure out how to
in MySQL to create a better
search feature.
---John Holmes...
-Original Message-
From: Håkan [mailto:hw2k;barrysworld.com]
Sent: Monday, November 11, 2002 4:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] wildcard search?
I'm trying to make a small and simple search function, but it only
RTFM...
http://www.mysql.com/doc/en/Pattern_matching.html
Håkan wrote:
I'm trying to make a small and simple search function, but it only works for
exact searches, and I can't figure out how to make a wildcard search, if I
do it in the php or in the mysql_query, can't really find anything about
I've tried doing a search for this problem on the web, but haven't found anything, nor
have I found any solution on the php.net documentation.
Does anyone know if it's possible to do a file search with a wildcard character? I
need to find if there are any HTML files in a certain directory,
How about:
$a = explode (' ', shell_exec (ls $foldername/*.html));
This should return an array that contains the name of all the *.html
files in the folder $foldername, if any.
Hope this helps.
Cheers,
Marco
-
php|architect -- The Monthly Magazine For PHP Professionals
Come
-Original Message-
From: Mako Shark [mailto:phpman2000;yahoo.com]
do I have to do a
readdir() and read the filename of every file until I find an
HTML or until all files have been read.
This is what the shell expression supplied by Marco Tabini actually does;
doing it in PHP
$a = explode (' ', shell_exec (ls $foldername/*.html));
Didn't know of shell_exec() until now. It works, though. Thanks!
Is there any reason why it wouldn't work? If I changed servers, say, and there were
some ports blocked and etc. etc., is there a risk that I should know?
Well, as a general rule, it won't work if you're not using a UNIX o/s or
if PHP has been set up with safe mode on, or if you don't have the right
permission to see that folder. That's probably a non-inclusive list, but
there should be ways around each of these problems (depending on the
degree of
Mako Shark wrote...
Didn't know of shell_exec() until now. It works, though. Thanks!
Is there any reason why it wouldn't work? If I changed servers, say, and there
were some ports blocked and etc. etc., is there a risk that I should know?
My understanding is that many security-conscious
Well, as a general rule, it won't work if you're not
using a UNIX o/s orif PHP has been set up with safe
mode on, or if you don't have the rightpermission to
see that folder. That's probably a non-inclusive list,
butthere should be ways around each of these problems
(depending on thedegree of
If you're only executing one-liners and get all the results back you're
better off using shell_exec(). popen() lets you open a pipe to a
command--that way, you can funnel data to it as if you were typing from
the keyboard.
Permissions would be a problem with readdir() as well.
Marco
--
If you're only executing one-liners and get all the
results back you're
better off using shell_exec(). popen() lets you open
a pipe to a
command--that way, you can funnel data to it as if
you were typing from the keyboard.
That's what I'll do then: use shell_exec().
Permissions would be
13 matches
Mail list logo