php中mysql_fetch_array和mysql_fetch_row的区别 - 疯子的紫梦's 学习窝
MySql数据库的列类型
AJAX实现用户注册检验

php中mysql_fetch_array和mysql_fetch_row的区别

疯子的紫梦 posted @ 2009年3月10日 20:19 in mysql , 2376 阅读

基本都一样,只是返回数组结构不一样。比如你用
SELECT name, age, gender FROM users WHERE age > 18


$row = mysql_fetch_array()得到的$row可以用0,1,2或‘name','age'来访问
也就是$row[0]=$row[name]=名字,$row[1]=$row[age]=年龄


mysql_result()和fetch_array()一样,而且支持用$row['user.age'],$row['user.name'],
在选用多个table时方便.


mysql_fetch_row()
只能用0,1,2,不能用‘name','age'
mysql_fetch_object()用$row->name,$row->age,$row->gender

Avatar_small
jnanabhumiap.in 说:
2024年1月12日 17:56

JNANABHUMI AP offers the most recent information on education. The primary idea or goal of this website has been to offer comprehensive resources with information on any subject that can be accessed online. To make sure that every reader finds out what they should know about the subject they are interested in and jnanabhumiap.in links to our content.Jnanabhumi AP is a startup founded by enthusiastic bloggers and webmasters who are driven to produce interesting, factual, and well-written content. We are similar to an online community where you can find a variety of resources, information, and topics about newsworthy events or daily occurrences.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter