mysql - 使用 phpMyAdmin 对多行进行 MySQL 替换查询
问题描述
我想用 wordpress mysql 表中的另一组行替换整个表中的一组行。
在 wp_posts 表中。
以下查询不起作用
UPDATE wp_posts
SET
field_name = REPLACE(post_content,
'<ul class="portfolio-list sort-destination" data-sort-id="portfolio">
<li class="col-md-4 isotope-item websites">
<div class="portfolio-item"><span class="thumb-info">
<span class="thumb-info-wrapper">
<img class="img-responsive" src="https://theinternationalrealtors.com/wp-content/uploads/2020/03/feature-your-property.jpg" alt="" /></span></span></div></li>
</ul>',
'<div class="col-md-12">
<div class="table-responsive table-responsive-sm">
<table class="table-bordered table-hover table-striped">
<thead>
<tr>
<th>Company</th>
<th>Name</th>
<th>Phone</th>
<th>Website</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>');
还有其他说法吗?有什么帮助吗?用 phpMyAdmin 来完成。或者有什么合适的wordpress插件可用?
1054 - '字段列表'中的未知列'field_name'
我用转义字符做了,但仍然错误
UPDATE wp_posts
SET
post_content = REPLACE(post_content,
'<ul class=""portfolio-list sort-destination"" data-sort-id=""portfolio"">\n
<li class=""col-md-4 isotope-item websites"">\n
<div class=""portfolio-item"">\n
<span class=""thumb-info"">\n
<span class=""thumb-info-wrapper"">\n
<img src=""https://theinternationalrealtors.com/wp-content/uploads/2020/03/feature-your-property.jpg"" class=""img-responsive"" alt=""""></span></span>\n
\n
</div></li>\n
</ul>',
'<div class=""col-md-12"">\n
<div class=""table-responsive table-responsive-sm"">\n
<table class=""table-bordered table-hover table-striped"">\n
<thead>\n
<tr>\n
<th>Company</th>\n
<th>Name</th>\n
<th>Phone</th>\n
<th>Website</th>\n
</tr>\n
</thead>\n
<tbody>\n
<tr>\n
<td></td>\n
<td></td>\n
<td></td>\n
<td></td>\n
</tr>\n
<tr>\n
<td></td>\n
<td></td>\n
<td></td>\n
<td></td>\n
</tr>\n
<tr>\n
<td></td>\n
<td></td>\n
<td></td>\n
<td></td>\n
</tr>\n
</tbody>\n
</table>\n
</div>\n
</div>');
解决方案
推荐阅读
- javascript - RN fs:本机模块不能为空
- r - 尝试将月份编号转换为日期集中的月份名称
- google-apps-script - 按名称获取范围并写回它
- r - 将每列总和除以矩阵的总和
- mysql - MySQL 查询具有多个玩家 ID 的俱乐部名称
- reactjs - 类型错误:类型'boolean | (() => void)' 不可分配给类型 'MouseEventHandler
| 不明确的' - kotlin-coroutines - 我对 ViewModel + Kotlin Coroutines + LiveData 中的代码有疑问
- android - 使 ImageViews 适合 Android GridLayout
- php - 从 Vtiger CRM 分配给模块联系人的用户数据
- php - 我想对应一个数据库,php告诉我那个未知的数据库但是当我使用cmd时它可以工作