Home > Backend Development > PHP Tutorial > 一个mysql查询的有关问题,马上就能结贴

一个mysql查询的有关问题,马上就能结贴

WBOY
Release: 2016-06-13 12:40:09
Original
756 people have browsed it

一个mysql查询的问题,在线等马上就能结贴
脑子糊涂了绕不过来这个弯  求助

我有两个表,t1表存储数据,t2表存储t1表字段的中文名称

t1



t2表



现在想写一条sql语句,能够查出t1表里 id in (1,2,3,4,5)的这几条记录每一个字段值的和,并且把字段名替换成t2表里对应的中文字段名,

结果类似于
array(
   "攻击时附加" =>  6,
   "暴击效果" => 7,
   ....
)

语句应该怎么写?   本来感觉应该不难的怎么就突然想不出来了   脖子都快抽筋了

是不是表设计的有问题? 有没有更好的方式

mysql 表设计 查询
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