To be or not to be.That is a question!

---源于莎士比亚的《哈姆雷特》

导航

随笔分类 -  php

codeigniter 分页类练习
摘要:controller page页:load->library("table"); $this->load->library("pagination"); } public function index(){ $config['base_url']='http://127.0.0.1/CI/index.php/blog/index'; $config['total_rows']=$this->db->get("CI_tb")->num_rows(); $ 阅读全文

posted @ 2013-08-12 16:12 Ijavascript 阅读(292) 评论(0) 推荐(0)

thinkphp curd操作
摘要:create()) { $result =$Form->add(); if($result) { $this->success('操作成功!'); }else{ $this->error('写入错误!'); } }else{ $this->error($Form->getError()); } } public function read($id=5){ $Form=M("... 阅读全文

posted @ 2013-07-25 16:33 Ijavascript 阅读(212) 评论(0) 推荐(0)

php Magic methods __call
摘要:_color; case 'setColor': $this->_color=$first; return $this; case 'getModel': return $this->_model; case 'setModel': $this->_model=$first; return $this; ... 阅读全文

posted @ 2013-07-25 09:33 Ijavascript 阅读(205) 评论(0) 推荐(0)

php 搜索练习
摘要:<?php require_once("connect.php"); if(isset($_GET['submit'])){ $name=$_GET['name']; $age=$_GET['age']; $wherelist=[]; if(!empty($_GET['name'])){ $wherelist[]=' name like "%'.$_GET['name'].'%" '; } if(!empty($_GET['age 阅读全文

posted @ 2013-06-03 15:41 Ijavascript 阅读(168) 评论(0) 推荐(0)

php分页练习
摘要:<?php require_once('connect.php'); $sel_query="select * from demotb"; mysql_query("set names utf8"); $sel_results=mysql_query($sel_query); /** * 分页信息设置 * * 1 设置当前页为$apage * 2 设置每页显示页数为$pagesize * 3 设置总共数量为$totalrows * 4 设置最大页数为$maxpage */ $page=... 阅读全文

posted @ 2013-06-03 14:25 Ijavascript 阅读(156) 评论(0) 推荐(0)

php mysql增、删、改、查
摘要:<?php require_once "connect.php";echo <<<_END<!DOCTYPE HTML><html dir="ltr" lang="zh-CN"> <head> <meta charset="utf-8"> <title></title> </head> <body> <form action="sql_test.php" method=& 阅读全文

posted @ 2013-05-29 23:55 Ijavascript 阅读(267) 评论(0) 推荐(0)

mysql test
摘要:<?php /** * @sqltest.php */require_once "app_config.php";if (isset($_POST['delete']) && isset($_POST['isbn'])) { $isbn=get_post('isbn'); $query="delete from classics where isbn='$isbn'"; if (!mysql_query($query)) { echo mysql_error(); }} 阅读全文

posted @ 2013-05-29 18:12 Ijavascript 阅读(214) 评论(0) 推荐(0)

Ubuntu 安装LAMP
摘要:Apache$sudo apt-get install apache2在浏览器中测试 http://localhostPHP$sudo apt-get install php5 libapache2-mod-php5重启Apache服务$sudo /etc/init.d/apache2 restart测试安装$sudo gedit /var/www/testphp.php添加测试语句<?php phpinfo(); ?>保存退出。在浏览器中测试 http://localhost/testphp.php$sudo rm /var/www/testphp.phpMySQL$sudo a 阅读全文

posted @ 2013-05-02 20:23 Ijavascript 阅读(168) 评论(0) 推荐(0)