今天接到客服部工作人员反馈的一个客户的问题,产品是允许用户添加一个产品属性的,而每个属性是由多个表单域组成 ,这样当每添加一个属性就等于添加了n个表单域,这个客户添加的非常的多,发现在提交保存的时候总是失败,提示其中一个表单元素的索引值不存在,经测试是发现服务端接收的一些表单域丢失了一部分。
起初分析的是服务器接收的数据超出了php设置的max_post_size(其实当时已经设置了8M,足够使用了),修改了测试发现此问题仍然存在。后来将用户原来的一些添加的表单元素进行删除,再重新添加同样数据库表单域可以成功,但一旦超出一定数量的表单域就会发生丢失的情况,这个时候首先怀疑的是apache是否有类似… Read More
t_user表如下
cj表如下:
要获得的查询结果:
解决办法:
方法一:
select cjc.uid,u.uname,cjc.数学,cjc.英语,cjc.语文,u.type from
(select uid,max(case subj when '数学' then score else 0 end) 数学,
max(case subj when '语文' then score else 0 end) 语文,
max(case subj when '英语' then score else 0 end) 英语
from cj
group by uid) cjc
left jo… Read More
一般有三种方法:
我们用名为 books 的表做演示
mysql> SELECT * FROM books LIMIT 3;
+----+-------------------------+---------------------+----------------+
| id | title | author | year_published |
+----+-------------------------+---------------------+----------------+
| 1 | In Search of Lost
Turn Off Warning/Error Reporting Temporary in PHP
Sometimes, your server side scripts performs operation that are not guaranteed to succeed all the time. For example, connection to another remote service. When the operation fails, PHP provides a warning or a error message. But that message is shown to the web user and may contain sensitive information