摘要: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(); $
阅读全文
摘要:create()) { $result =$Form->add(); if($result) { $this->success('操作成功!'); }else{ $this->error('写入错误!'); } }else{ $this->error($Form->getError()); } } public function read($id=5){ $Form=M("...
阅读全文
摘要:_color; case 'setColor': $this->_color=$first; return $this; case 'getModel': return $this->_model; case 'setModel': $this->_model=$first; return $this; ...
阅读全文
摘要:<?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
阅读全文
摘要:<?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=...
阅读全文
摘要:<?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=&
阅读全文
摘要:<?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(); }}
阅读全文
摘要: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
阅读全文