$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()期望参数1是资源,
我希望得到this
我需要这个来处理highstock
答案 0 :(得分:2)
使用int count=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
//all that is below is within oncreate
final int[] drawablearray=new int[]{R.drawable.one,R.drawable.two,R.drawable.three,R.drawable.four,R.drawable.five};
gettingBackground(drawablearray);
}
private void gettingBackground(final int[] drawablearray) {
// TODO Auto-generated method stub
new Handler().postDelayed(new Runnable() {
public void run() {
if(count<drawablearray.length){
LoginAct.this.getWindow().
setBackgroundDrawableResource(drawablearray[count]);
count++;
gettingBackground(drawablearray);
}
else{
count=0;
}
}
}, 5000);
}
- 然后:
$result=DB::table('Table_26') ->select('id','data','((unix_timestamp(time) * 1000) as datetime)->order_by('datetime')->get()->toArray();