0

I have imported my database by script from live site to my local server.

I have menu system dynamically generated by database. they are in table like below:

id   name     linkpage
1    blog     http://www.example.com/blog/index.php
2    about    http://www.example.com/blog/about.php

I have to change live url in to my local url like http://www.example.com/blog/index.php to http://localhost/mysite/blog/index.php

How can I update link page column with mysql query ?

2 Answers 2

3

It's simple. You can do with replace function:

 UPDATE tablename SET linkpage=REPLACE(linkpage,'www.example.com','localhost/nysite')
Sign up to request clarification or add additional context in comments.

Comments

0

with replace function;

mysql_query("UPDATE your_tablename SET linkpage=REPLACE(linkpage,'www.your_link.com','localhost/mysite')")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.