Remote db and results
-
Hello Peter,
I created a new blank HTML page purely for testing purposes and keeping it simple.
I have a view that I have used successfully as a Data Publication WP Data Access Premium. I wanted to custom style the results so installed Code Manager after I saw some response and code in the WPDA support forum. I tried that code first without success.
$wpdadb = WPDADB::get_db_connection( ‘rdb:my_db’ );
$rows = $wpdadb->get_results( ‘select * from my_view‘, ARRAY_A);The code example mentioned above is a little different from the example in the PHP code library example, but I figured I would try the library code next…
<?php $wpdadb = WPDataAccess\Connection\WPDADB::get_db_connection( ‘rdb:my_db’ ); $rows = $wpdadb->get_results( ‘select * from my_view‘ ); var_dump($rows); ?>
This did not return results either. Steps I have taken:
1) Verified names of db and view (several times)
2) Checked settings in both WPDA and CM (several times)
3) Tested ‘Hello World’ PHP shortcode successfully to verify shortcodes and CM are workingIs there something obviously incorrect in what I have above? If not, do you have an example of code I could put in to confirm that the connection was made, or can you suggest a next step in debugging this? Thank you and very much appreciated.
- The topic ‘Remote db and results’ is closed to new replies.