mysql_fetch_assoc() 期望参数 1 为资源,数组给定 {Laravel}
mysql_fetch_assoc() expects parameter 1 to be resource , array given {Laravel}
$result=DB::table('Table_26') ->select('id','data','((unix_timestamp(time) * 1000) as datetime)
->order_by('datetime')
->get();
$rows = array();
while($r = mysql_fetch_assoc($result['sql'])) {
$rows[] = $r; }
print json_encode($rows);
一个获取问题
mysql_fetch_assoc() expects parameter 1 to be resource,
我想变得像this
我需要这个来与 highstock
一起工作
使用$result=DB::table('Table_26') ->select('id','data','((unix_timestamp(time) * 1000) as datetime)->order_by('datetime')->get()->toArray();
- 然后:
while($r = $result['sql']) {
$result=DB::table('Table_26') ->select('id','data','((unix_timestamp(time) * 1000) as datetime)
->order_by('datetime')
->get();
$rows = array();
while($r = mysql_fetch_assoc($result['sql'])) {
$rows[] = $r; }
print json_encode($rows);
一个获取问题
mysql_fetch_assoc() expects parameter 1 to be resource,
我想变得像this
我需要这个来与 highstock
一起工作使用$result=DB::table('Table_26') ->select('id','data','((unix_timestamp(time) * 1000) as datetime)->order_by('datetime')->get()->toArray();
- 然后:
while($r = $result['sql']) {