今天上午刚同事发来的数据。做了一个: http://www.atool.org/12306.php 代码很简单,主要就是数据文件导入到数据库中就好了~不知道贴什么代码,就贴数据库查询的这个类吧~ 无 ?phprequire_once 'mysql.class.php';/** * 仅供参考 */class D12306Dao extends
今天上午刚同事发来的数据。做了一个:
<?php require_once 'mysql.class.php'; /** * 仅供参考 */ class D12306Dao extends Mysql { public function __construct() { parent::__construct(); } //邮箱 public function find_by_email($keyword) { $sql = "select name from d12306 where email = '$keyword';"; return $this->exec_query($sql); } //身份证 public function find_by_uid($keyword) { $sql = "select name from d12306 where uid = '$keyword';"; return $this->exec_query($sql); } //账号 public function find_by_userid($keyword) { $sql = "select name from d12306 where userid = '$keyword';"; return $this->exec_query($sql); } public function insert($email, $userid, $name, $uid, $password, $phone) { $sql = "insert into d12306(email, userid, name, uid, password, phone) values('$email', '$userid', '$name', '$uid', '$password', '$phone');"; return $this->exec_update($sql); } } ?>