<?php
require('config.php');
echo phpversion().'<br />'; //PHP版本号
echo $serverEnv['phpversion'] = phpversion() >= '4.3'; //等同于if phpversion > 4.3
echo $serverEnv['mysql'] = function_exists('mysql_connect').'<br />';//验证MYSQL是否可用
/**
 * MySQL 4.1.3 以上支持 mysqli
 * is_readable -- 判断给定文件名是否可读(或目录)
 * is_writable -- 判断给定的文件名是否可写(或目录)
 * file_exists -- 检查文件或目录是否存在
 * realpath -- 返回规范化的绝对路径名
 */
$extensions = get_loaded_extensions();
dump($extensions);
if (in_array('mysqli',$extensions)) 
{
     echo '支持Mysqli扩展';
}
if (in_array('gd',$extensions)) 
{
     echo '支持GD库';
}
$conn = new mysqli('127.0.0.1','root','sansirok','wokao');
$result=$conn->query("set names 'gb2312'");
$result = $conn->query("CREATE TABLE `navs` (
  `nav_id` int(11) NOT NULL auto_increment,
  `nav_kz` char(1) collate gb2312_bin NOT NULL,
  `nav_name` char(20) collate gb2312_bin NOT NULL,
  `nav_url` varchar(255) collate gb2312_bin NOT NULL,
  PRIMARY KEY  (`nav_id`),
  KEY `nav_kz` (`nav_kz`)
) ENGINE=MyISAM  DEFAULT CHARSET=gb2312 COLLATE=gb2312_bin AUTO_INCREMENT=10");
if (!$result) 
{
     echo 'cuowu';
}
else 
{
	echo 'ok';
}
?>