易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

【转】 sql统计-关于学生成绩

sql统计-关于学生成绩
http://blog.sina.com.cn/s/blog_61380b320100ej9k.html
 
 
sql统计-关于学生成绩
学生成绩表(stuscore):
姓名:name
课程:subject
分数:score
学号:stuid
张三
数学
89
1
张三
语文
80
1
张三
英语
70
1
李四
数学
90
2
李四
语文
70
2
李四
英语
80
2
创建表
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[stuscore](
    [name] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
    [subject] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
    [score] [int] NULL,
    [stuid] [int] NULL
) ON [PRIMARY]
 
GO
SET ANSI_PADDING OFF
问题:
1.    计算每个人的总成绩并排名(要求显示字段:姓名,总成绩)
2.    计算每个人的总成绩并排名(要求显示字段: 学号,姓名,总 ......

【转】 sql统计-关于学生成绩(答案)

sql统计-关于学生成绩(答案)
http://blog.sina.com.cn/s/blog_61380b320100ej9p.html
答案:
1.       计算每个人的总成绩并排名
select name,sum(score) as allscore from stuscore group by name order by allscore
2.   计算每个人的总成绩并排名
select distinct t1.name,t1.stuid,t2.allscore from  stuscore t1,
(
    select stuid,sum(score) as allscore from stuscore group by stuid
)t2
where t1.stuid=t2.stuid
order by t2.allscore desc
3. 计算每个人单科的最高成绩
 select t1.stuid,t1.name,t1.subject,t1.score from stuscore t1,
(
select stuid,max(score) as maxscore from stuscore group by stuid
) t2
where t1.stuid=t2.stuid and t1.score=t2.maxscore
4.计算每个人的平均成绩
select distinct t1.stuid,t1.n ......

为PHP安装Xdebug调试工具

一、zend studio的配置
1.到zend的安装目录下删除两个文件(可有可无.至少我不删除也不移动可以)
   我的安装目录:D:\Program Files\Zend\Zend Studio - 7.0.2\plugins\
   删除的文件是:com.zend.php.debug.core_7.0.0.v20090607-1658.jar
                           com.zend.php.debug.ui_7.0.0.v20090618-1658.jar
如果你舍不得删,可以把他们剪切出来嘛。现在选择windows->preferences ->PHP->debug 在php debug 下拉菜单中就 应该能看见xdebug的选项了。
2.更改php executables
   由于我没有使用zend studio自带的php环境,所以这里要添加我的php5.3.1环境。
选择windows->preferences ->php->php executables
   点击add按钮添加:executable path:   D:\server\php5.3\php.exe
                         &n ......

将PHP代码转换到Scala代码

有一个开源项目提供将PHP代码转换成Scala代码的功能,该项目的网站是 http://code.google.com/p/php-to-scala-migration-helper/。
In short, php-to-scala converts PHP code to clean, maintainable Scala source code. To cut to the chase, see ConversionExamples, or the feature-by-feature DesignDocument.
PHP-to-Scala Migration Helper is technically a PHP Compiler, but it differs radically from other existing compilers such as Hip-Hop, PHC, Raven, Roadsend, Phalanger, and Quercus, in a few key points (see: KeyDifferences for details), most importantly the primary, usable output of the tool is nice, maintainable Source Code, not executable or Java bytecode. ......

Nginx+PHP 配置漏洞

这个漏洞严格上说并不是 Nginx 和 PHP 本身的漏洞造成的,而是由配置造成的。在我之前写的许多配置中,都普遍存在这个漏洞。
简易检测方法:
打开 Nginx + PHP 服务器上的任意一张图片,如:
http://blog.lrenwang.com/test.png
如果在图片链接后加一串 /xxx.php (xxx为任意字符)后,如:
http://blog.lrenwang.com/test.png/xxx.php
图片还能访问并且输出的 Content-Type 为 text/html 的话,说明你的配置存在漏洞。
分析原因
Nginx 传给 PHP 的值为 /var/www/lrenwang/test.png/xxx.php,即 $_SERVER 中 ORIG_SCRIPT_FILENAME 的值,但是 $_SERVER 中 SCRIPT_FILENAME 却是 /var/www/test/test.png。
原因是,/var/www/lrenwang/test.png/xxx.php 并不存在,对于这些不存在的路径,PHP 会检查路径中存在的文件,并将多余的部分当作 PATH_INFO。
这里,/var/www/lrenwang/test.png 被 PHP 解析为 SCRIPT_FILENAME,/xxx.php 被 PHP 解析为 PATH_INFO 后被丢弃,因此并没有在 $_SERVER 中出现。
解决方法:
解决这个漏洞的方法很显然:关闭上面所述的解析即可。
这个解析可以在 PHP 的配置文件中设置,默认为开启。在这里我们需要将它关闭:
;cgi.fix_pathinf ......

PHP CURL详解

声明:补充翻译了原帖中几处未翻译处。
---------------------------------------------------- 转帖开始 -------------------------------------------------------
PHP中的CURL函数库(Client URL Library Function) 
curl_close - 关闭一个curl会话 
curl_copy_handle - 拷贝一个curl连接资源的所有内容和参数 
curl_errno - 返回一个包含当前会话错误信息的数字编号 
curl_error - 返回一个包含当前会话错误信息的字符串 
curl_exec - 执行一个curl会话 
curl_getinfo - 获取一个curl连接资源句柄的信息 
curl_init - 初始化一个curl会话 
curl_multi_add_handle - 向curl批处理会话中添加单独的curl句柄资源 
curl_multi_close - 关闭一个批处理句柄资源 
curl_multi_exec - 解析一个curl批处理句柄 
curl_multi_getcontent - 返回获取的输出的文本流 
curl_multi_info_read - 获取当前解析的curl的相关传输信息 
curl_multi_init - 初始化一个curl批处理句柄资源 
curl_multi_remove_handle - 移除curl批处理句柄资源中的某个句柄资源 
curl_multi_select - Get all the ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [417] [418] [419] [420] 421 [422] [423] [424] [425] [426]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号