2014-06-27 67 views
0
讀取所有數據
my code is connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);SELECT @phonenos as PhoneNos;SELECT @nameofstop as NameOfStop;SELECT @busstartstatus as BusStartStatus',function(err,result){ 

console.log("connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);SELECT @phonenos as PhoneNos;SELECT @nameofstop as NameOfStop;SELECT @busstartstatus as BusStartStatus'"); 

我的問題是有如何使用循環

24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A, 24245676856859870D0A,242457658658786870D0A,24245676856859870D0A,242457658658786870D0A

現在它只能採取lastdata即242457658658786870D0A

+0

你給出的數據作爲字符串或數組? – Sadikhasan

回答

0

如果數組給定的數據存儲,然後使用foreach循環這樣

foreach($data as $str) 
{ 
    echo $str."<br>"; 
}