wpdb not working with custom table
-
I created a table tbl_Buildings for which I am not able to get the data from.
When I run the top query alone, it works. But together or the second query alone it display nothing like there is a fault.
I verified the table and field names of course 😉
Hope you have an idea why it is not working.
global $wpdb; $wpdb->show_errors(); <p>From Database </p> $fivesdrafts = $wpdb->get_results( " SELECT ID, post_title FROM $wpdb->posts" ); foreach ( $fivesdrafts as $fivesdraft ) { echo $fivesdraft->post_title; } <p>From Civ TBG </p> $CivTBGs = $wpdb->get_results( " SELECT Building_ID FROM $wpdb->tbl_Buildings" ); foreach ( $CivTBGs $CivTBG) { echo $CivTBG->Building_ID; } $wpdb->print_error(); echo "Test";
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘wpdb not working with custom table’ is closed to new replies.