Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 打印mysql查询的结果_Php_Mysql - Fatal编程技术网

Php 打印mysql查询的结果

Php 打印mysql查询的结果,php,mysql,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 d

我使用下面的查询来获得结果,我在打印结果时遇到了麻烦,我将结果传递给数组并将其发布到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"));

mysql\u fetch\u row
将以数组格式返回数据。因此,要获取数据,应使用以下代码:

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