[PHP-DB] newlines to BR tag

2004-10-02 Thread Murat BIYIKLI
if there are unknown number of newlines repeating like (\r\n\r\n\r\n) in a
post var and if I want to change them to a SINGLE newline, what kind of an
iteration should be used? The message may like below in DB and as you see
the \r\n newline codes may repeat severaltimes and should be changed to only
one SINGLE newline and after read from DB it will be easily coverted to BR
tag by nl2br($foo) func.

KIRKUK, Iraq (AP)\r\n\r\n - Iraqi engineers have fixed most of the damage
caused by a sabotage attack earlier this month on the main pipeline that
carries Iraqi oil to Turkey, but the country is still depending on a network
of substitute lines to export crude, an official with the North Oil Co. said
Monday. \r\n\r\n\r\n\r\n The official said 75 percent of the work has been
done but few more days are needed for the 40-inch pipeline to be ready for
exports to the Turkish port of Ceyhan. \r\nThe pumping rate is still down to
250,000 barrels a day from the normal average of 400,000 barrels, the
official said on condition of anonymity. Exports will go back to normal when
the line is fixed, he said.

SHOULD BE CHANGED LIKE (all new lines to a single newline):

KIRKUK, Iraq (AP)\r\n - Iraqi engineers have fixed most of the damage caused
by a sabotage attack earlier this month on the main pipeline that carries
Iraqi oil to Turkey, but the country is still depending on a network of
substitute lines to export crude, an official with the North Oil Co. said
Monday. \r\n The official said 75 percent of the work has been done but few
more days are needed for the 40-inch pipeline to be ready for exports to the
Turkish port of Ceyhan. \r\nThe pumping rate is still down to 250,000
barrels a day from the normal average of 400,000 barrels, the official said
on condition of anonymity. Exports will go back to normal when the line is
fixed, he said.

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



[PHP-DB] MySQL performance and crash

2004-10-01 Thread Murat BIYIKLI
I use a Linux web server with PHP-MySQL. The hardware is good enough with
2GHz CPU and 1 GB RAM. and 7200 Cycle/min Serial ATA IDE HDD. Only one web
site is running on it and on every page of that site, it searchs for a value
in Users table including 78000 records and updates that value. The MySQL
crashes on everyweek and needs to be killed and restarted, sometimes the
server becomes unreachable and needs to be restarted.
Do you think MySQL is not stable or bad configured? How to optimize that and
monitor what goes wrong, or is it time for Oracle?

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



[PHP-DB] Re: searchengine input split

2004-09-30 Thread Murat BIYIKLI
I can't get an efficient solution, the sql query to be generated by input
keywords should be boolean.
The input value should be splitted boolen like Google, they are
with all the words, with the exact phrase, with at least one of the words,
without the words..
an example input is :: america,asia bush OR kerry "iraq  war" -democrat
SQL Where condition:
WHERE (message LIKE %america% AND message LIKE %asia%) OR (message LIKE
%bush% OR message LIKE %kerry%) AND message LIKE %iraq  war% AND NOT LIKE
%democrat%

Anyone has a code for this purpose?

"Murat Biyikli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I need to split the keyword on search input and generate an sql query,
> for ex:   the input value is:   europe+america,asia
> so I want to generate an sql like this:
> SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE
%america%
> OR message LIKE %asia%
>
> The + (plus) means AND and , (comma) means OR. Also I need to control
input
> variables to prevent error on sql query forexample an input value like:
> ,,,europe+america,+asia+should not generate an error.

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



[PHP-DB] spliting keywords by GET method and SQL query

2004-09-30 Thread Murat BIYIKLI
I need to split the keyword on search input and generate an sql query,
for ex:   the input value is:   europe+america,asia
so I want to generate an sql like this:
SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE %america%
OR message LIKE %asia%

The + (plus) means AND and , (comma) means OR. Also I need to control input
variables to prevent error on sql query forexample an input value like:
,,,europe+america,+asia+should not generate an error.

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



[PHP-DB] searchengine input split

2004-09-30 Thread Murat BIYIKLI
I need to split the keyword on search input and generate an sql query,
for ex:   the input value is:   europe+america,asia
so I want to generate an sql like this:
SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE %america%
OR message LIKE %asia%

The + (plus) means AND and , (comma) means OR. Also I need to control input
variables to prevent error on sql query forexample an input value like:
,,,europe+america,+asia+should not generate an error.

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