both answers were great and helped me a lot ,i used the following to get to wp-config file without really Knowing all database details
require_once('../wp-config.php');
include_once ('../wp-load.php');
$con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD , DB_NAME);
Related Posts:
- Creating 20,000 Posts or Pages using a .csv file?
- How to properly insert data into custom table via plugin
- Searching users with WP_List_Table plugin
- Updating WooCommerce variable product stock issue
- Bad Request (Invalid Hostname) on working server, database problem
- How to write one comment and publish on every post using database or plugin?
- How to get number of Affected rows from wordpress dbDelta() function
- Plugin Development sqlite or WordPress’ database
- Display data on Word Press site posts and pages from mysql table
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- WpDataTables – View Image Directory
- WordPress WPforms customization
- How do I run SQL queries on a WordPress web page? [closed]
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Enabling WP_USE_EXT_MYSQL to support old plugin
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- Redirect to another page using contact form 7? [closed]
- pagination on data fetched using SQL query
- Speeding SQL queries for a large database?
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- Woocommerce Backend Search by Title and SKU
- How can I fetch data from another website to my wordpress website with mysql database
- speed up pagination for huge database
- Way to send multiple values for column to MySQL?
- How to display results from a data table with an encrypted user id?
- Check against server time to display SQL entries – Radio Station DJ Rotator Plugin
- add_action for publish_post doesn’t work
- WordPress Cache delete on plugin uninstall
- need to find duplicated meta value in custom filed and view the posts that have the same value
- JOIN and SUM different statement results (Mailster Database)
- Getting current user data with MySQL statement
- How to get the custom field value using SQL query
- Memcaching recurring SQL Queries
- WP Function does not trigger on Webhook API Call
- Cant create table on plugin activation
- Performing CRUD operations on front end in wordpress
- Display a number value from mysql query in WP
- Looping the data from WordPress database using foreach
- Moving a few select DB tables to a new WP instance
- How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?
- How To Toggle User_Meta in frontend in a form using PHP
- Get and Update Most Meta Value as an array in HTML form
- WordPress filter from custom table is not working properly
- get/show Last ID
- MySql Query for WordPress
- Using wp config to connect to a DB from a plugin
- how to search through plugin in wordpress cimy-user-extra-fields?
- Get all the related data from WordPress DB
- PHP Creating a formula from mysql db values and db stored math operator
- How to change and edit users according to the extension in the URL
- Split Million WordPress Post’s Into Multiple Database Server
- Getting 504 Gateway Timeout Error on AWS Server! [closed]
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- How to get the list of WooCommerce product image of a certain category from database?
- Insert plugin content before body end
- How To Ignore a Filter On Applying Filter the Content In a Function
- Add CSS animation as Preloader to WordPress
- How can I ‘reactivate’ .PHP files within a WP plugin that have been marked ‘inactive’?
- How to use wp-ajax in wp-cron
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- Using spl_autoloading within WordPress plugin
- TechCrunch WP Asynchronous Tasks plugin still works on v4.7.5? [closed]
- Dashboard Widget Form
- Why Better WP security plugin returns 418 I’m a Teapot “error”?
- How to determine what is generating large amount of database queries?
- Get post by ASC from custome field DATE picker
- Set Post Format if find a string in title or post content
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- How to sanitize uploaded file filename from a plugin?
- Using a custom plugin to capture input data via Ajax and PHP
- Set and access global variable
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Enabling plugin failed because MySQL user do not have CREATE permissions
- Notify comment author upon reply
- add_action into another add_action not working
- Add User Role: Pre-saved in User-Meta [SOLVED]
- How to make a dynamic css class whose name changes every visit to confuse scraper
- How WordPress core manage the plugin installation
- Shortcode not working – quotes seems strange
- Using custom fields for image alt and title
- Deactivation Hook does not remove database
- How to display registered customer list as dropdown in WooCommerce checkout?
- “Allowed memory size” problem [closed]
- Echo out element to another page.
- Show prices with tax Inclusive in Minicart widget
- Custom fields not showing up in the user info (PaidMembershipsPro)
- How do I use a plugin’s shortcode attribute value in another function?
- Change the address of the music player if not available
- WordPress hide post from custom post-type on a single page
- update_post_meta is not working for me when I use e.preventDefault for update button
- Use modulo condition in ACF repeater Field
- Add a WooCommerce Product Variant with attributes programmatically
- Site broken by unedited php?
- Help with customising love it plugin (use within foreach)
- Plugin communication between sites that use it?
- What is the process for reimplementing a back up WordPress?
- Showpost and last
- Displaying Category Feature image on loop
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)