Title: Can&#8217;t get serialized php array to work
Last modified: January 6, 2018

---

# Can’t get serialized php array to work

 *  Resolved [jacoballen4](https://wordpress.org/support/users/jacoballen4/)
 * (@jacoballen4)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/)
 * Can’t get this to work. WPDataTables always throws a “Table in data source has
   no rows.” It work with $test, but cant get it to work otherwise. HELP!
 *     ```
       <?php
       // get current user data
       global $current_user;
       get_currentuserinfo();
       $userAuther  = array('author' =>  $current_user->ID);
       $args = array('post_type' => 'property-tour','post_status' => 'any' ); 
       // check if admin user logged in 
       if(!current_user_can('manage_options')){
       	$args =  array_merge($userAuther,$args);		
       }
       // get all tours data                                            
       $the_query = new WP_Query( $args );
   
       // The Loop
       if ( $the_query->have_posts() ) {
   
           echo '';
           while ( $the_query->have_posts() ) {
               $the_query->the_post();
       		?>
   
       				<?php
       	               			$address = get_post_meta(get_the_ID(),'wpcf-street-address',true);
       	               			$city    = get_post_meta(get_the_ID(),'wpcf-city',true);
       	               			$state   = get_post_meta(get_the_ID(),'wpcf-state',true);
       	               			$zip     = get_post_meta(get_the_ID(),'wpcf-zip-code',true);				
       	               			$mls     = get_post_meta(get_the_ID(),'wpcf-mls-if-available',true);				
       	               			$price   = get_post_meta(get_the_ID(),'wpcf-order_total',true);	 
       	               			$billing = (get_post_meta(get_the_ID(),'tour_payment',true)) ? "yes" : "no";				
       	               			$frontend_image = (get_post_meta(get_the_ID(),'wpcf-frontend-image',true)) ? '<a href="'.get_post_meta(get_the_ID(),'wpcf-frontend-image',true).'" data-gallery="" none><img style="width:100px;" class="listing_image_tour" src="'.get_post_meta(get_the_ID(),'wpcf-frontend-image',true).'"/></a>': "N/A";	
   
   
       			     ?>	
   
       					$final[] = array(<?php echo get_post_status ( get_the_ID() );?> , $<?php echo $price;?> , <?php echo $billing; ?> , <?php echo get_the_author(); ?> , <?php echo get_the_date(); ?> 
       					, image , <?php echo $address;?> , (<?php echo $city;?>, <?php echo $state;?>) , 0);
   
   
       		<?php
   
           }
           echo '';
           /* Restore original Post Data */
           wp_reset_postdata();
   
       } 
   
       else {
           // no posts found
   
       }
   
       //echo serialize( $final );
   
       ?>
   
       <?php
   
       $test = array(
           array(0, 1, 2, 3, 4, 5, 6, 7, www.yahoo.com, word),
           array(3, 4, 5),
           array(6, 7, 8, 9),
       );
   
       echo serialize( $final );
   
       ?>
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcant-get-serialized-php-array-to-work%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [jacoballen4](https://wordpress.org/support/users/jacoballen4/)
 * (@jacoballen4)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/#post-9838987)
 * Warning: include(jamadmin.com/wp-blog-header.php): failed to open stream: No 
   such file or directory
 *  Thread Starter [jacoballen4](https://wordpress.org/support/users/jacoballen4/)
 * (@jacoballen4)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/#post-9838992)
 * [https://www.dropbox.com/s/ojrm6vkrbj37by4/Help.jpg?dl=0](https://www.dropbox.com/s/ojrm6vkrbj37by4/Help.jpg?dl=0)
 *  Thread Starter [jacoballen4](https://wordpress.org/support/users/jacoballen4/)
 * (@jacoballen4)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/#post-9840455)
 * Nevermind. I found a script to solve my problem much faster. DataTables.net for
   anyone that is looking for a MUCH easier route…
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/#post-9877036)
 * Hi there,
 * Does the PHP file that you created return a proper string with serialized array
   when you call it directly? Can you make sure that the HTTP code is 200/OK?
 * Thanks.

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

The topic ‘Can’t get serialized php array to work’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/cant-get-serialized-php-array-to-work/#post-9877036)
 * Status: resolved