连接数据库
$dbcnx = @mysql_connect ( "localhost", "root", "1234" ); if (! $dbcnx) { echo ("Unable to connect to the " . "database server at this time."); exit (); } if (! @mysql_select_db ( "pms" )) { echo ("Unable to locate the joke " . "database at this time."); exit (); }
设定字符
mysql_query ( "SET NAMES 'GB2312'" );
查询
$q=mysql_query("select `Right` from employee where username ='".$username."'");
赋值
$right=mysql_fetch_row($q)