易截截图软件、单文件、免安装、纯绿色、仅160KB

利用php获取数据库中所有信息可参考phpMyAdmin


<?php
@mysql_connect("localhost", "root","1981427") //选择数据库之前需要先连接数据库服务器
or die("数据库服务器连接失败");
$dbs = mysql_list_dbs(); //调用mysql_list_dbs函数
while ($array = mysql_fetch_row($dbs)) //循环输出所有的数据库名称
{
echo "$array[0]<BR>";
}
?>
<?php
@mysql_connect("localhost", "root","1981427") //选择数据库之前需要先连接数据库服务器
or die("数据库服务器连接失败");
$dbs = mysql_list_tables("test"); //调用mysql_list_tables函数
while ($array = mysql_fetch_row($dbs)) //循环输出所有的表名称
{
echo "$array[0]<BR>";
}
?>
<?php
mysql_connect("localhost","root","1981427"); //连接服务器
mysql_select_db("test"); //选择数据库
$result = mysql_query("SELECT * from tablename1"); //执行查询操作
echo mysql_num_fields($result); //获取列的数目
?>
<?php
mysql_connect("localhost","root","1981427");
mysql_select_db("test");
$result = mysql_query("SELECT * from tablename1");
echo mysql_field_name($result,0); //获取列的名称
?>
<?php
mysql_connect("localhost","root","1981427");
mysql_select_db("test");
$result = mysql_query("SELECT * from tablename1");
echo mysql_field_type($result,0); //获取列的数据类型
?>
<?php
mysql_connect("localhost","root","1981427");
mysql_select_db("test");
$result = mysql_query("SELECT * from tablename1");
echo mysql_field_len($result,0); //获取列的长度
?>
<?php
mysql_connect("localhost","root","1981427");
mysql_select_db("test");
$result = mysql_query("SELECT * from tablename1");
echo mysql_field_flag($result,0); //获取列的标志
?>
<?php
mysql_connect("localhost","root","1981427"); //连接服务器
mysql_select_db("test"); //选择数据库
echo "<table border='1'>"; //输出表头
echo "<tr><th>列名</th><th>类型</th><th>长度</th><th>标志</th>";
$result = mysql_query("SELECT * from tablename1"); //在mytable表上执行SQL语句
$fields = mys


相关文档:

php面试题附答案二

1、如何实现字符串翻转?
<?php
function getStr($str){
        $len=strlen($str);
        for ($i=0;$i<$len/2;$i++){
                $temp=$str[$i ......

PHP面向对象分析设计的61条军规

PHP面向对象分析设计的61条军规
你不必严格遵守这些原则,违背它们也不会被处以宗教刑罚。但你应当把这些原则看成警铃,若违背了其中的一条,那么警铃就会响起 。 ----- Arthur J.Riel
(1)所有数据都应该隐藏在所在的类的内部。
(2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。
(3)尽量减少类的协议中 ......

php smarty 安装 、配置、使用 及缓存cache的配置使用

cache 使用:
    cache配置:
    $smarty->cache_dir = "/caches/";  //缓存目录   
    $smarty->caching = true;  //开启缓存,为flase的时侯缓存无效   
    $sma ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号