php - Wordpress- can I include wp-config to get db details -
i making change existing wordpress site on checkout page when user types suburb/postcode, looks list database.
rather writing code connect mysql, php file can include wordpress directories include connection?
if not, problem in including wp-config.php database details , connect their?
you can use wpdb after including necessary files, change directory fit needs:
include_once $_server['document_root'] . '/wp-config.php'; include_once $_server['document_root'] . '/wp-load.php'; include_once $_server['document_root'] . '/wp-includes/wp-db.php'; oh , if don't know is: http://codex.wordpress.org/class_reference/wpdb
Comments
Post a Comment