在php mysql中显示数组

时间:2018-05-21 04:03:34

标签: php mysql

我正在尝试在php mysql中插入和显示元素数组。将数据插入表格工作正常。显示多个字段时会显示错误import os import csv source_csv = os.path.join("..","C:/Users/Desktop/","data.csv") with open(source_csv,newline="") as csvfile: csvreader = csv.reader(csvfile,delimiter=",") next(csvreader) # skip the headers sortedlist = sorted(csvreader, key=lambda row: row[0], reverse = True) print(sortedlist) 。在php mysql中显示数组可能是什么原因?

这是代码

Uninitialized string offset: 0

1 个答案:

答案 0 :(得分:0)

 while($row=mysql_fetch_array($run))

 while($row=mysql_fetch_assoc($run))