[PHP] rather a mysql question

2002-05-03 Thread Ando Saabas

Sorry that this is more of a mysql question, but since most php
programmers use it a lot, i though i might find the answer without
subscribing to mysql list, here goes:
When i do a query from a big table using indexes,it takes for example 5
seconds. Now if i, after
some time repeat the query, the query takes about 0.5 secs.
So far i thought it was because of caching, but now i read mysql (v3.23)
doesnt
support query cache. So this really gets me wondering, where does the
speed increase come from?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] regular expression for (NOT 'word')

2002-03-14 Thread Ando Saabas

how would i build a regular expression in php that would match
everything but the given word. For example, match the string only if
there isnt a word 'php' in the string.
I understand i can list characters i dont want to see in the string:
[^php].
but this means there cant be any p or h in the string. And ^(php) checks
if the string starts with 'php'.
How should i do it?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expression for (NOT 'word')

2002-03-14 Thread Ando Saabas

Ok let me explain my problem further some. I need the regular expression to
purify the html page from script tags:
I used: $file = eregi_replace((script(.*).*/script),  , $file);
Now this works fine, until theres a webpage like:

script somethingscript data./script
Some webpage data
script somethinganother script data /script

so the regexp above replaces everything between first script  and last
/script ie the webpage data also.
So i thought to change the regexp to something like this:  $file =
eregi_replace((script(.*)NOT(script)/script),  , $file);
where NOT(script) would match everything that contains word script




Rick Emery wrote:

 the best you can do is:

 ?php
 $a = this has php  in the string;
 if( ! ereg(php, $a ) )
 { print a: not in string; }
 $a = this has in the string;
 if( ! ereg(php, $a ) )
 { print b: not in string; }
 ?

 -Original Message-
 From: Ando Saabas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 14, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] regular expression for (NOT 'word')

 how would i build a regular expression in php that would match
 everything but the given word. For example, match the string only if
 there isnt a word 'php' in the string.
 I understand i can list characters i dont want to see in the string:
 [^php].
 but this means there cant be any p or h in the string. And ^(php) checks
 if the string starts with 'php'.
 How should i do it?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP output during longer program run times

2002-03-06 Thread Ando Saabas

Lets say i have a script  that runs for a longer period of time, 1-10
minutes.
Id like the script to give output as to what it is doing while it runs,
but the problem is, that it
wont print output on runtime, but it will output everything at the same
time after it has completed the whole job.
Even if i let it to print something out on the first line.
Any workaround for this?

running php 3.0.12 installed as apache module


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Extracting hyperlinks from file

2002-02-21 Thread Ando Saabas

I need to produce an array of all the links(hrefs) in a remote file
(actually those that refer to files in the same remote server, but thats

another matter).
I'm pretty new to php, i was thinking of doing it with ereg, something
like eregi(a href[\]?=(.*), $file, $link);
but i cannot think of a way to make it walk through the whole string, so

it would find all the links, not just the first one.
Any ideas?

Ando


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Extracting hyperlinks from file

2002-02-21 Thread Ando Saabas

I need to produce an array of all the links(hrefs) in a remote file
(actually those that refer to files in the same remote server, but thats
another matter).
I'm pretty new to php, i was thinking of doing it with ereg, somethin
like
 eregi(a href[\]?=(.*), $file, $link);
but i cannot think of a way to make it walk through the whole string, so
it
would find all the links, not just the first one.
Any ideas?

Ando


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php