/* The users table consists of three fields:
* user_id
* username
* password.
*/
$link = mysql_connect('localhost', "mysql_user", "mysql_password");
mysql_select_db($dbname, $link)
or die("Could not set $dbname");
$res = mysql_query("select * from users", $link);echo mysql_field_name($res, 0) . "\n";
echo mysql_field_name($res, 2);
The above example would produce the following output: user_id
password
* user_id
* username
* password.
*/
$link = mysql_connect('localhost', "mysql_user", "mysql_password");
mysql_select_db($dbname, $link)
or die("Could not set $dbname");
$res = mysql_query("select * from users", $link);echo mysql_field_name($res, 0) . "\n";
echo mysql_field_name($res, 2);
The above example would produce the following output: user_id
password
解决方案 »
- 请教个数据库设计的问题
- 关联表的删改,大家是怎么处理的?
- Mysql数据库远程访问
- mysql 数据库都删除了空间还是不释放
- Mysql 的一个小问题,急呀。。。
- 请问一些GROUP BY 的问题
- 求助:现在有表A,表B,2个表都有字段id,请用左联方法写出一句sql,从2个表中找出id相等的纪录
- 使用mysql-front能直接向表中插入数据吗?(不用自己写sql语句)-----------???在线等待------------????
- 菜鸟求救:我运行 ./mysqladmin -u root -p password '你的新密码'有问题
- c++ 【连接】【mysql】
- mysql安装在linux8.0上的问题!
- how to use plpgsql
可以得到表的所有字段,再循环比较吧。