思路原理代码如下: 1 prepare($sql) or die($mysqli->error); 9 //绑定参数10 $name="小倩";11 $password="xiaoqian";12 $email="aa@sohu.com";13...
分类:
数据库 时间:
2015-01-06 17:22:20
阅读次数:
190
1 conn = mysql_connect($this->host,$this->root,$this->password) or die('连接数据库失败'.mysql_error());21 mysql_select_db($this->dbname);22 ...
分类:
数据库 时间:
2015-01-05 10:46:38
阅读次数:
178
又宅了一天!直到朋友来了一个电话,告诉我今天跨年夜,我活的还真是忘了日子。在电脑面前坐了一天,脑子也疼的要死,不知道是因为被这看不见的辐射给射的,还是说C++那乱指渐欲迷人眼的指针。打开窗户,感受了一下这凛冽的北风,脑子一抽,就准备出去转转。今晚再不出去走走,今年还真是没有机会了。说到这里,也是忧伤,都说no zuo no die。想想也是自己前两年zuo的厉害,搞到现在又成功的熬过一年单身狗,紧...
分类:
其他好文 时间:
2014-12-31 22:51:37
阅读次数:
201
1、数据打印echo,可以同时输出多个字符串,多个参数,无返回值print,只能输出一个字符串,一个参数print_r,用于输出数组die,先输出内容,在退出程序var_dump如果想查看某个表达式的值和类型,用var_dump(),如果只是想得到一个表达式的类型,用gettype(),查看某个类型,用is..
分类:
Web程序 时间:
2014-12-30 19:20:20
阅读次数:
246
#! /usr/bin/perluse Getopt::Std;use warnings;use strict;sub read_from_sh($) { my $file = shift; my @files = (); open F, $file or die "Could n...
分类:
其他好文 时间:
2014-12-26 18:38:23
阅读次数:
335
1.文件读写与命令行参数#!/usr/bin/perlusestrict;if(@ARGV<2){die"USAGE:perl$0inputfileoutfile\n";}my($infile)=@ARGV[0];my($outfile)=@ARGV[1];openmy$infile_fh,‘‘,"$infile"||die("Can‘topenthefile!");openmy$outfile_fh,‘>>‘,"$outfile"||die("Can‘topenthef..
分类:
其他好文 时间:
2014-12-26 14:51:45
阅读次数:
155
无中间文件计算fdr
#!perl
use warnings;
use strict;
die "perl $0 \n" if @ARGV != 2;
my (%va, %out);
open FA, $ARGV[0] or die $!;
while()
{
chomp;
my @tmp = split;
$va{$tmp[0]} = $tmp[...
分类:
其他好文 时间:
2014-12-23 10:26:55
阅读次数:
201
1,var_dump:输出内容和结构 dump:thinkPHP定义的打印内容与结构 Common/common.php 定义一个打印函数
<?php
function?p?($array){
????dump($array,1,‘<pre>‘,0);
}
?>
使用
p($_GET);die;
p($_POST);die;...
分类:
Web程序 时间:
2014-12-19 02:05:58
阅读次数:
211
在PHP中经常看到如下代码if (!defined('IN_ECS')) { die('Hacking attempt'); } 实现的原因以及原理如下: ecshop里的有些.php页是不需要用户通过url直接访问的,用来被其它页调用的,例如/includes/init.php,就不需要直接...
分类:
其他好文 时间:
2014-12-18 00:08:57
阅读次数:
203
原文:PHP经验——获得PHP版本信息及版本比较偶然看到别人写的一句代码: ")) { die("PHP 5.2 or greater is required!!!"); } ?> 发现获取PHP的版本信息原来这么简单~~~
PHP_VERSION是一个常量,他就能获得PHP版本信息。
versio...
分类:
Web程序 时间:
2014-12-17 12:21:53
阅读次数:
138