WPDB and Word Press Pages
-
I am new to WP but think its great and certainly consuming. I have cracked most of where I want to be and now hit a wall. I am trying to call data from a table whether it be the same as the WPDB or externally. I have read the instructions and find myself cornered.
Q1 Can I put php code directly into a page created for the website e.g. page 32 when called? If so why is it not executing properly merely displaying part of the text e.g. It misses the first <php
opening tag then displays (ignore the ” ” its the exact text between
“
global $wpdb;
$myrows = $wpdb->get_results( “SELECT id, name FROM myTable” );
?>
“
Q2 If I can access the table direct from the page what am I doing wrong?
Q3 Can someone point me correctly as to how to make $WPDB global? I dont understand fully classes but have some understanding of php, mysql and can build the outines outside of wordpress – but don’t want to as I am hooked with it now ?? Any help would be appreciated
Thanks in advance.
Steve
- The topic ‘WPDB and Word Press Pages’ is closed to new replies.