Home > Backend Development > PHP Tutorial > 请问一个PHP编程有关问题

请问一个PHP编程有关问题

WBOY
Release: 2016-06-13 12:06:16
Original
970 people have browsed it

请教一个PHP编程问题
逻辑如下:
从A表中搜索出结果,逐个循环显示结果(A1,A2,A3......),并且循环的结果要与B表的搜索结果(B1,B2,B3....)进行对比。如果A中的结果与B中某个结果相等,那么我需要update一下在A表中标记出来。

我应该怎么写程序,请教大概思路
------解决方案--------------------
UPDATE A表, B表 SET A表.flag=值 WHERE A表.字段=B表.字段 and 条件;

------解决方案--------------------
关联表更新
update a,b set a.标记=1 where a.a=b.b

Related labels:
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