Hi,
I'm trying to update all the links in the content in my MySQL database.
This piece of code does the job fine:
$content = eregi_replace("\?(id|m)=(.+)\"","\\2/\"",$content);
ie. ?id=80" would be changed to 80/"
I want to put this php function into a MySQL update query.
I suppose i need to ues the SUBSTRING_INDEX string function in the query, but how?
I'm totally lost at this point... please help!
Thread about MySQL and PHP functions:
<!-- m --><a class="postlink" href="http://www.phpbuilder.com/forum/read.php3?num=5&id=4769&thread=4763">http://www.phpbuilder.com/forum/read.ph ... hread=4763</a><!-- m -->
MySQL documentation about string functions:
<!-- m --><a class="postlink" href="http://www.mysql.com/doc/S/t/String_functions.html">http://www.mysql.com/doc/S/t/String_functions.html</a><!-- m -->
Thanks,
Andy
I'm trying to update all the links in the content in my MySQL database.
This piece of code does the job fine:
$content = eregi_replace("\?(id|m)=(.+)\"","\\2/\"",$content);
ie. ?id=80" would be changed to 80/"
I want to put this php function into a MySQL update query.
I suppose i need to ues the SUBSTRING_INDEX string function in the query, but how?
I'm totally lost at this point... please help!
Thread about MySQL and PHP functions:
<!-- m --><a class="postlink" href="http://www.phpbuilder.com/forum/read.php3?num=5&id=4769&thread=4763">http://www.phpbuilder.com/forum/read.ph ... hread=4763</a><!-- m -->
MySQL documentation about string functions:
<!-- m --><a class="postlink" href="http://www.mysql.com/doc/S/t/String_functions.html">http://www.mysql.com/doc/S/t/String_functions.html</a><!-- m -->
Thanks,
Andy