Title: No rows found
Last modified: January 3, 2024

---

# No rows found

 *  Resolved [eagleonemedia](https://wordpress.org/support/users/eagleonemedia/)
 * (@eagleonemedia)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/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.
 *     ```wp-block-code
        $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)
       ```
   
    -  This topic was modified 2 years, 4 months ago by [eagleonemedia](https://wordpress.org/support/users/eagleonemedia/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [eagleonemedia](https://wordpress.org/support/users/eagleonemedia/)
 * (@eagleonemedia)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/no-rows-found/#post-17315583)
 * The exact error – Table in data source has no rows.
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/no-rows-found/#post-17317859)
 * Hello,
   When we try using your PHP code and placing it on a PHP file on our Server,
   we are also getting the same error if we try to create a PHP Table : Table in
   data source has no rows.But if we try with our own PHP array sample file, then
   we can not get any errors.
 * What you can do now to troubleshoot is, first  try our sample PHP test file, 
   and try to make a PHP Array table from it on your WordPress.
 * Here is the link to our PHP test file :[https://wpdatatables.com/sample_files/show_documentation.php](https://wpdatatables.com/sample_files/show_documentation.php)
 * This PHP file works on our Test site for the Lite wpDataTables.
   Here is a screenshot:
 * ![](https://i0.wp.com/ticksy_attachments.s3.amazonaws.com/5018499891.png?ssl=
   1)
 * If this works on your site when you make a new PHP Table,
 *  it means that the issue you have is not coming from our plugin,
 * but it is either a server issue or an issue with the file itself.
 * If it turns out that the issue is not coming from our plugin, but rather  file/
   server/permission issue, or the way how you formatted your file,
 * unfortunately, our support does not cover searching for errors in your file, 
   or fixing server/permission issues.
 * The correct format for our Plugin of the serialized array should be the following:
   2D-array, where the parent level is an indexed array, and the second level is
   an associative array. Parent array entries will be parsed as rows, child array
   keys will be parsed as column headers, and child array values as cell values.
 * ​Please check more details explained on our [Documentation here.](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-serialized-php-array/)​
 * And you can also examine how we formatted it on our Test file, then try to edit
   your PHP file in order to get the right format for our Plugin.
 * We hope this helps.
 * Kind regards.
    -  This reply was modified 2 years, 4 months ago by [wpDataTables](https://wordpress.org/support/users/wpdatatables/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘No rows found’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/no-rows-found/#post-17317859)
 * Status: resolved