代替拼接的办法

WBOY
Release: 2016-06-06 20:09:34
Original
866 people have browsed it

字段 voted_uid
要将符合条件的用户id写入该字段,有没有最简单的办法
比如写入后得到10001,10005,10521,10242

我的土办法是:

<code>1.把该字段的数据取出来。
2.查找是否已有该id。
3.如果没有就把原数据拼接上当前用户id。
4.更新该字段。
</code>
Copy after login
Copy after login

框架是thinkphp

回复内容:

字段 voted_uid
要将符合条件的用户id写入该字段,有没有最简单的办法
比如写入后得到10001,10005,10521,10242

我的土办法是:

<code>1.把该字段的数据取出来。
2.查找是否已有该id。
3.如果没有就把原数据拼接上当前用户id。
4.更新该字段。
</code>
Copy after login
Copy after login

框架是thinkphp

你就不能再建个表唉
id voted_id voted_uid

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!