Error during displaying results in a table from the database
-
Hi,
I want to display some data “in a table already created in my website” from my database.
I have already created a part of code to filled my table with the data already stored in my database as follows:
// creation of my table <div class="my_box3"> <div class="box_title"><?php echo __("Title"); ?></div> <div class="box_content"> <table border="1"> <tr><th>A1</th><th>City</th><th>A2</th><th>A3</th><th>A4</th></tr> <?php // fill my table with recovered data $ci=get_post_meta(get_the_ID(), 'CITY'); $ci=array_filter($ci[0]); $ci=array_values($ci); for($i=0;$i<count($ci);$i++) {?> <tr><td><?php echo load_by_id($co[$i],"table","ID",$wpdb)->NAME;?> <?php }?> </table> </div> </div>
It’s running locally on my PC even if I leave some empty box but when I put In in my cPanel I get this error message:
Warning: array_filter() expects parameter 1 to be array, string given in /home/…
Warning: array_values() expects parameter 1 to be array, null given in /home/…
in these lines:
$ci=array_filter($ci[0]);
$ci=array_values($ci);Any help will be appreciated and Thanks in advance
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Error during displaying results in a table from the database’ is closed to new replies.