No rows found
-
Good afternoon!
Please could you kindly help me with this? I am trying to fetch an Array from a php file and when I run it in the console the format is the same as the example. But the plugin returns no rows found which is odd,
Do I have something wrong? I have linked the PHP file in links and the code below. Thank you in advance.
$dbconn = pg_connect("host=$dbhost dbname=$dbname user=$dbuser password=$dbpass") or die('Could not connect: ' . pg_last_error()); $query = 'SELECT statistics.player_ucid, players.name, SUM (kills) AS total, SUM (kills_planes) AS A2A, SUM (kills_ground) AS A2G, SUM (deaths) AS losses FROM STATISTICS INNER JOIN players on statistics.player_ucid = players.ucid GROUP BY player_ucid, players.name ORDER BY total DESC'; $result = pg_query($query) or die('Error message: ' . pg_last_error()); $return_array = array(); // Initializing the array that will be used for the table while ($row = pg_fetch_assoc($result)){ $return_array[] = array('UCID' => $row[player_ucid],'NAME' => $row[name]); } echo serialize( $return_array ); print_r($return_array)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘No rows found’ is closed to new replies.