Search and Repalce - MySQL

When I first started building mys computer components website I was totally new to programming - I knew a little HTML but that was it.

Thankfully on the Internet there are a few helpful people who are willing to share their skill of PHP and MySQL.

You can use this code in phpmyadmin or any other database manager

UPDATE table name SET Table Field = replace(table field,"string to find","string to replace")

On of the things that I found really helpful was how to search for a specific string within a database and replace that string. There are hundreds of reasons that you may wish to do this but an example is this:

Say within your site you are optimising you product pages and you want to ensure you internal linking structure points your users to the correct pages. You could search for every instance of ” computer components ” and make it link to the relevant page. This is great fro SEO purposes.

Of course there are other reasons why you may use it, perhaps you want to add a style or class to every table. This is made easy with search and replace.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • StumbleUpon
  • Technorati

46 Responses to “Search and Repalce - MySQL”

  1. mark from phone service Says:

    That is a great tip. It does make a difference in Seo if you do this. Since it takes very little time everyone should do it to help sites seo.

    marks last blog post..Broadband phone voip service.

  2. Sam from DIY Solar Panels Says:

    Omg this rocks! This would be great for SEO. Thank you very much!

  3. Rob from Online Poker Rakeback Says:

    Well there’s something I didn’t know. Right now I’m about where you were when you first started. As you said, great for SEO, but it seems that it would also be a big timesaver. Thank you for the tip.
    *bookmarked*

    Robs last blog post..SNG Strategy Pt. 2 - Make money playing Sit and Go poker tournaments

  4. cathy from Key west travel Says:

    That is a good idea. It does seem to help seo of the site and should let you get more traffic.

    cathys last blog post..Hotels in key west.

  5. chuggin from good coffee makers Says:

    I tried my best, but I had to break down and outsource from Elance.

  6. amy from Black mold removal Says:

    Thanks i have to try and do this. I know it helps each page in search engines and should help get more website traffic.

    amys last blog post..Mold removal.

  7. Mark from Review Says:

    I was wondering if this code can be used in ASP.net. I am kind of novice in this. Please help me out.

  8. 642-533 exam Says:

    Very impressed with the knowledge you are posting here. Thanks for sharing and let us know more about new releases. 642-825 exam

  9. Amy from Free Xbox 360 Says:

    That seems like a great concept for SEO. I know next to nothing about web design, I’ve started stumbling around CSS and XHTML, php is a mystery to me.

  10. matthew from internet franchises Says:

    Ahhh well, I dont code so it’s all gobbledygook to me. Will point my coder to it though and see if it is of use :D

  11. Vancouver Web Design Says:

    This is an enormous time saver, thank you !

  12. siamese cat Says:

    The best example over the net. I have been (re)searching this topic for quite some time unfortunately there is a bunch of logs quoting this “update [table_name] set [field_name] = replace([field_name],’[string_to_find]‘,’[string_to_replace]‘);”

    which works only in the most idiotic cases. The examples above are golden :)

    Thanx!

  13. rasim from How Do I Get Rid Of The Trojan Horse Virus Says:

    great blog I love that you keeped your blog keywordluv thanks.

  14. austinjames from SEO Marketing Ireland Says:

    Nice tips here!
    Thanks for the linkback to my site because of keyword luv

  15. jon-jon from songs Says:

    Well, I really admire SQL and html.

    I think people who want to get settled with internet world or make money out of it, should get at least very basic foundation of both.

  16. Greig from Leadership Says:

    A veru useful little string there - one that my low level of coding knowledge wouldn’t have allowed me to create on my own, so thankyou!

  17. rasmus from søgemaskineoptimering Says:

    Great tip! thank you.
    Does this SQL sentence work with mssql aswell? Anyone?

  18. Hotels Says:

    Well, I too admire SQL and html.

    These are very easy to learn and they pay you higher.

  19. Neeraj Says:

    Besides having some computer knowledge one must have command over English.

  20. Jewellery Says:

    I am very impress this site. sql server is very nice, so thanks for this post.

  21. Tollywood songs Says:

    Thank u ver much for posting such a nice article on sql

  22. bennet from english speaking course Says:

    This is an amazing idea. Thanks for this excellent tip which would be very useful for seo. I will bookmark your site. Thanks a ton for posting such an awesome article. Love to read most of your writings.

  23. manu from advertising agency toronto Says:

    Its a great tip.I am experiencing it in my daily work.Thanks for such valuable post.

  24. senior dating services Says:

    i think its a great tip and i really like this stuff its time saver.

  25. sam from Mp3 download song Says:

    this is a great tip and pretty impressive and thanks for sharing

  26. Towel Warmers Says:

    I like phpmy admin to do the database stuff - it’s easier

  27. sam from How to make money in Philadelphia Says:

    this is wonderful to read and pretty interesting and sql server is nice and thanks for sharing.

  28. sam from Chiropractic software Says:

    well i don’t have so much knowledge of mysql but i have knowledge of HTML,this is good to read,
    thanks!

  29. accept checks by fax Says:

    Wrong query syntax may ruin the field you are performing replace on, so always backup first.

  30. seo Says:

    Thanks web site..

  31. Dollar Items Says:

    thread starter’s post is written wonderful. Writing is smooth, dignified rhetoric

  32. yiwu Says:

    good work

  33. Virginia from Tips to lose weight Says:

    You start learning php/mysql/html pretty fast when you get involved into it. A year ago I knew nothing about php, now I have my own php store.

  34. sesli chat Says:

    thank you very much

  35. wholesale electronics Says:

    Here have a variety of advanced technology to produce electronic products,
    http://www.trademic.com
    Most wholesale electronics today use semiconductor apparatus to accomplish electron control. The abstraction of semiconductor wholesale electronics and accompanying technology is advised a annex of physics, admitting the architecture and architecture of cyberbanking circuits to break applied problems appear beneath go to wholesale electronics,engineering. This commodity focuses on engineering aspects of electronics.wholesale electronics is a able manufacturer, specializes in development, manufacture. We accept broad Cheap Consumer Electronics, China wholesale Electronics go!: Like Cheap Unlocked Cell Phones, Hiphone, MP3 Players, MP4 Players, MP5 Players, Computer Accessories, Car Electronics, Bluetooth Products, USB Flash Drive, Memory Cards, Health & Beauty, iPod & iPhone Accessories, Digital Photo Frames,Car Audios, Car DVD Players, Digital Cameras, Digital Camcorders, Video Game Accessories, Spy Cameras, Security Products and Electronic Gadgets from China.
    We accept over 2500 accomplished and accomplished advisers and our accessories of 7,300 aboveboard meters are able with avant-garde productions and testing machines. We accept the absolute superior ascendancy arrangement and strive to accommodated and beat our customer’s expectations,wholesale electronics.
    Do you find mbt lami shoes for a long time. Here is the richest in the world and you can find your needs bring you harvest. yes,
    http://www.mbtsonsale.com mbt lami shoes Purple Shoes is the first physiological footwear that has a positive effect on the whole body. buy mbt lami shoes ’s sole is curved, not flat. Anti-shoe is unstable, not stable. Swissmasai activates your muscles instead of undermining them. The mbt lami shoes Birch Shoes Chapa feature feature rich nubuck leather with single-layer mesh upper bodies for strong but breathable wear,mbt lami.

  36. Women's Handbags Says:

    thank you for you posts

  37. sesli chat Says:

    Thank you admin very good

  38. Adam from Free iPod Says:

    This post is awesome, thanks for it.

  39. MBTshoes Says:

    Many people have heard of health shoes, but don’t know what they are and they are asking the question, “What is a pair of health shoe?” A pair of health shoe contributes to general health. This doesn’t mean your feet will absorb some magical supplement that will make you healthy when you wear a health shoe. What it does mean is that when you wear a pair of health shoe, it will contribute to you being healthier. Health shoes are also known as fitness shoes and walking shoes.

  40. sesli chat Says:

    selam güzel site thank you admin

  41. cheap mbt shoes Says:

    thank you for your share

  42. ghd Says:

    Hello,I’m new here! This is my first post! I find many good information at this forum. I have bookmark this forum . I will tell my friends this site. Thanx for your sharing. I will come again.

  43. cheap ghd Says:

    That’s a very good post! I have learnt so much from this post! And I will tell my friends this website. Thanx for your sharing.

  44. discount mbt shoes Says:

    A pair of health shoe contributes to general health.

  45. skechers Says:

    I’m a shoes fans.I like shoes very much.

  46. seslichatevi Says:

    teşekkürler güzel paylaşım.

Leave a Reply

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.