mysqli_fetch_assoc()
或PDO::FETCH_ASSOC
将结果集转换为关联数组。,4. 将每个记录添加到PHP数组中。,,以下是示例代码:,,``php,,
`,,这段代码会从名为
users的表中选择
id,
name, 和
email列,并将结果存储在PHP数组
$users`中。php,,
``asp,Function GetMultipleValues(), Dim arr(2), arr(0) = "Value1", arr(1) = "Value2", GetMultipleValues = arr,End Function,,Dim result,result = GetMultipleValues(),Response.Write(result(0)) ' 输出 Value1,Response.Write(result(1)) ' 输出 Value2,
``Powered By Z-BlogPHP 1.7.3
Copyright Your WebSite.Some Rights Reserved.