从mysql查询打印结果

时间:2013-06-24 10:32:48

标签: php mysql

我正在使用以下查询来获得结果,我坚持以格式打印结果,我将其传递给数组并将其发布到Twitter任何提示

$query = "SELECT CONCAT('#', hashtag) AS hashtag, sum(count) as total 
          FROM `trending_topics` WHERE lang=1 and  hashtag != '' and 
          date >= date_sub(left(now(), 10), interval 2 day) group by hashtag 
          order by total desc LIMIT 0, 3";   

$message = mysql_fetch_row($query); 

$tweet->post('statuses/update', array('status' => "Trending topics $message"));

1 个答案:

答案 0 :(得分:1)

mysql_fetch_row将以数组格式返回数据。 sot获取您应该使用以下代码的数据:

$tweet->post('statuses/update', array('status' => "Trending topics".implode($message)));