WP Database, show array results in table
-
Hi there!
I am trying to show some database results on a wordpress page.
I did some research and have used this code:
<?php $table_name = $wpdb->prefix . "scoreboard"; $sql = "SELECT <code>text-51938c6978af6</code> FROM <code>wp_fm_data_6</code> "; $pageposts = $wpdb->get_results($sql, ARRAY_N); print_r($pageposts); echo $pageposts[0]['team1']; ?>
On my wordpress page, I get the following result:
Array ( [0] => Array ( [0] => Testformulier ) [1] => Array ( [0] => hoihallo ) )
“Testformulier” and “hoihallo” are the values I want to show on my page, but I want only this values in a table or something like that. So basically it have to look fancy and without the array code etc
I was trying to get the values in a table, and tried some things but I can’t make it work.
Anybody that could help?
(Sorry for my bad english)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP Database, show array results in table’ is closed to new replies.