利用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
相关文档:
2008 年 12 月 29 日
像其他语言一样,开发人员可以用 PHP 编写出各种质量级别的代码。学习良好的编程习惯能够提高代码质量和效率。
根据具体的情况,一般的开发人员往往比优秀的开发人员的效率低 10%~20%。优秀的开发人员的效率更高,因为他们拥有丰富的经验和良好的编程习惯。不良的编程习惯将会影响到效率。本文通过展 ......
整理一篇比较详细的windows下php运行环境的配置的资料,包括apache的安装、mysql的安装、php的安装、 ZendOptimizer 的安装、phpMyAdmin的安装,包括安装过程会出现的问题的解决,比如:phpMyAdmin数据库中文乱码的解决等。
//****************
1、软件
(1)apache_2.2.4-win32-x86-no_ssl.zip
(2)mysql-5.0.27-win32.zi ......
VC9,VC6,Thread Safe,Non Thread Safe的意思?
时间:2009-10-07 10:55来源:网络 作者:CNITonline.com整理 我要投稿 注册IT家园
最近在PHP官网上看到又有新版的PHP下载了,于是上去找找For Windows的版本,可是一看确傻眼了,一共给了四个版本,VC9 x86 Non Thread Safe、VC9 x86 Thread Safe、VC6 x86 Non Thread Safe、VC ......
cache 使用:
cache配置:
$smarty->cache_dir = "/caches/"; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$sma ......