How to deal with mysql statements-php Tutorial

Source: Internet
Author: User
Tags mysql delete
Mysql statement: a mysql deletion statement that deletes all URLs... for example, if an article contains a URL link, I want to delete all the URLs, www.baidu.com or www.baidu.com, and write the delete statement ------ solution ---------------- updatetables mysql statement
Could you tell me a mysql delete statement that deletes all URLs... for example, an article contains a URL link, I want to delete all the URLs, http://www.baidu.com or www.baidu.com to delete this delete statement in how to write

------ Solution --------------------
Update table set fieldName = fieldName. str_replace...
------ Solution --------------------
Delete records with URLs
Delete from table name where field name link '% www.baidu.com %'

Remove the URL from the content
Update table name set field name = field name. str_replace ('www .baidu.com ','')
------ Solution --------------------
It's okay to replace the http://www.baidu.com.
Attention sequence:
SQL code
Update table name set field name = field name. str_replace (http://www.baidu.com ', '') update table name set field name = field name. str_replace (www.baidu.com ','')
------ Solution --------------------
SQL code
Update table name set field name = field name. str_replace ('http: // www.baidu.com ', '') update table name set field name = field name. str_replace ('www .baidu.com ','')
------ Solution --------------------
I learned it. Thank you .......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.