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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -