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
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
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.
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.
$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
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 =
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 =
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
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
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
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
: [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
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
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
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
15 matches
Mail list logo