I am trying to make a localhosted WordPress site use the ODBC connections I use for business analytics.
I made a plugin and am trying to reference the functions in shortcode (because this is the only way I know to do this).
Below is my code:
$dsn = '****';
$user = '****';
$pw = '****';
$connect = odbc_connect($dsn, $user, $pw);
if ($connect == true){
echo '<br> connected <br>';
} else{
echo '<br> not connected <br>';
}
From what I understand this should be testing to see if the connection is open and it gives me an error (posted below). My big question is if I need to install an ODBC driver on the site to make it able to perform the connection.
If so, where do I find this?
I use four MS SQL servers on the domain and would also like to be able to work with access and excel.
Fatal error: Uncaught Error: Call to undefined function odbc_connect() in C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-content\plugins\HPM-custom\HPM.php:54
Stack trace:
#0 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-includes\shortcodes.php(326):HPM_API_E2('', '', 'HPM_API_E2')
#1 [internal function]: do_shortcode_tag(Array)
#2 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-includes\shortcodes.php(223):preg_replace_callback('/\\[(\\[?)(HPM_AP...','do_shortcode_ta...','[HPM_API_E2]\n[H...')
#3 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-includes\plugin.php(235):do_shortcode('[HPM_API_E2]\n[H...')
#4 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-includes\post-template.php(240):apply_filters('the_content', '[HPM_API_E2]\n[H...')
#5 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-content\themes\generatepress\content-page.php(24):the_content()
#6 C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-includes\template.php(574):require('C:\\Bitnami\\word...')
#7 C:\Bitnam in C:\Bitnami\wordpress-4.5.3-1\apps\wordpress\htdocs\wp-content\plugins\HPM-custom\HPM.php on line 54