[PHP-DB] Replacing subtring within table record

2004-11-15 Thread ioannes
I want to replace one substring with another within a MySQL table record, eg a blob. Do I need to extract the record and do it in php or can I do it directly with mysql? The Replace Syntax notes in mysql.com seem to relate to replacing the whole row and I'm not quite confident with shell

[PHP-DB] replacing dynamic variable in preg_replace

2004-09-15 Thread Steve Morgan
I am working on a script which takes a list of variables form a database. The problem i am currently having is some of the variables have other variables in the content , i.e. $temp=h1$title/h1 (made up example), is something that might come out of the mysql. $query=mysql_query(SELECT

Re: [PHP-DB] replacing dynamic variable in preg_replace

2004-09-15 Thread John Holmes
Steve Morgan wrote: I am working on a script which takes a list of variables form a database. The problem i am currently having is some of the variables have other variables in the content , i.e. $temp=h1$title/h1 (made up example), is something that might come out of the mysql.

[PHP-DB] replacing once with ereg_replace

2004-01-19 Thread lisi
I have a problem with two possible solutions, I'm just not sure how to do either one. I have a number of pages and their links stored in a MySQL db. The links are stored without the leading slash (i.e. animals/birds/birds.htm). $PHP_SELF returns the link with the leading slash (i.e.

Re: [PHP-DB] replacing once with ereg_replace

2004-01-19 Thread Ricardo Lopes
$new_php_self = substr($PHP_SELF, 1); Does this has anything to do with db?? - Original Message - From: lisi [EMAIL PROTECTED] To: PHP-DB [EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:21 AM Subject: [PHP-DB] replacing once with ereg_replace I have a problem with two possible

[PHP-DB] Replacing + with question

2003-09-30 Thread Graeme McLaren
Hi all I want the contents of a variable to be returned to the user without the + symbols, how do I do that? This is what I have so far by the string replace function doesn't replace the spaces and display bla bla bla as I want: $AddressLine1 = urlencode($AddressLine1); $AddressLine1 =

Re: [PHP-DB] Replacing + with question

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 01:06, Graeme McLaren wrote: This is what I have so far by the string replace function doesn't replace the spaces and display bla bla bla as I want: Probably it's because you're trying to replace spaces with +. Swap your first 2 parameters. $AddressLine1 =

Re: [PHP-DB] Replacing + with question

2003-09-30 Thread Graeme McLaren
the part up to the first space is displayed back to the user. Any ideas? Cheers again, Graeme :) - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 30, 2003 7:12 PM Subject: Re: [PHP-DB] Replacing + with question On Wednesday 01

Re: [PHP-DB] Replacing + with question

2003-09-30 Thread CPT John W. Holmes
From: Graeme McLaren [EMAIL PROTECTED] Jason, thank you for reply. I tried switching the 1st 2 parameters in the str_replace function so that it now looks like this: $AddressLine1 = urlencode($AddressLine1); $AddressLine1 = str_replace(+, , $AddressLine1); Unfortunately as I am now

[PHP-DB] Replacing * with %

2002-01-15 Thread Markus Lervik
Hello all! I can't for the love of god get neither ereg_replace nor str_replace to work. I wan't to replace * with % so I can use SELECT ... WHERE whatever LIKE string% in MySQL. I've tried ereg_replace(*,%,$search_name). Didn't work. I tried escaping the asterisk. I tried double-escaping the

RE: [PHP-DB] Replacing * with %

2002-01-15 Thread matt stewart
be possible to delimit them with slashes, that would be my thinking anyway. Let me know if i'm right or (more likely) wrong! cheers, Matt -Original Message- From: Markus Lervik [mailto:[EMAIL PROTECTED]] Sent: 15 January 2002 09:40 To: [EMAIL PROTECTED] Subject: [PHP-DB] Replacing

RE: [PHP-DB] Replacing * with %

2002-01-15 Thread matt stewart
: [PHP-DB] Replacing * with % /* sorry markus, forgot to post this to the list, so here it is again! */ don't know if this is the solution without doing some reading, so i'll tell you what i think it might be and you can read up on it! is either (or both?) * and % special characters in regular

RE: [PHP-DB] Replacing * with %

2002-01-15 Thread Rosser, Chris
The following works fine for me: $currentword = ereg_replace(\*,%,$currentword); Chris }:) -Original Message- From: matt stewart [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, January 15, 2002 9:57 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Replacing * with % just checked

RE: [PHP-DB] Replacing * with %

2002-01-15 Thread matt stewart
excellent! two ways to do it - Markus confirmed that [*] works too - so don't know which is better, but we have two solutions anyway. -Original Message- From: Rosser, Chris [mailto:[EMAIL PROTECTED]] Sent: 15 January 2002 10:54 To: '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] Replacing

Re: [PHP-DB] Replacing * with %

2002-01-15 Thread Bruno Gimenes Pereti
Lervik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 15, 2002 7:40 AM Subject: [PHP-DB] Replacing * with % Hello all! I can't for the love of god get neither ereg_replace nor str_replace to work. I wan't to replace * with % so I can use SELECT ... WHERE whatever LIKE string