$userInfo = $this->db->get('user')//user为user表名
或者
$query = "select * from user"
$this->db->query($query)
<?php$mysql_server_name='localhost'
$mysql_username='root'
$mysql_password='12345678'
$mysql_database='mycounter'
$conn=mysql_connect($mysql_server_name,$mysql_username,$mysql_password,$mysql_database)
$sql='CREATE DATABASE mycounter DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci
'
mysql_query($sql)
$sql='CREATE TABLE `counter` (`id` INT(255) UNSIGNED NOT NULL AUTO_INCREMENT ,`count` INT(255) UNSIGNED NOT NULL DEFAULT 0,PRIMARY KEY ( `id` ) ) TYPE = innodb'
mysql_select_db($mysql_database,$conn)
$result=mysql_query($sql)
//echo $sql
mysql_close($conn)
echo "Hello!数据库mycounter已经成功建立!"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)