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
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- How to remove duplicate Custom Fields?
- Calling a plugin in theme development
- wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn’t creating any tables on plugin activation
- Display a text message if the field is not found and not if found
- Unable to activate wordpress importer after installing it
- Reposition Woocommerce Message
- greatest() function returns undefined property
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Get total number of comment of the posts written by an author
- What SQL / WordPress queries would need a nonce?
- How do you remove plugin edit option?
- Can you limit the memory usage of a particular plugin?
- Escape when echoed
- Scope for PHP Variables Assigned in functions.php or a plugin
- add_meta_box (Will display only in specific page admin WordPress)
- Make specific products accessible only to a user role in WooCommerce
- force customers to add only single item to card per purchase EDD [closed]
- Undefined property: WP_Post_Type::$ID
- Plugin exceeds memory limit
- How to get post URL in the_content filter?
- How to remove xmlns on language_attributes()?
- Add a plugin before main container
- Shortcode to generate and save password in a file
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to get member list based on role by using buddypress?
- I don’t understand how this parameter works..?
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- Single Must Use Plugins Directory for local development
- Enable Full SSL for WordPress
- How to initialize something in unit test before the init hook being called?
- Missing argument 3 for wp_register_sidebar_widget()
- Make id column as AUTO INCREMENT on plugin activation
- How to Include a Loop Template File in a Plugin
- Write to / remove from default .htaccess file from plugin?
- Update Option Error: Notice: Undefined index
- How can I display a contact form for out of stock products in WooCommerce?
- Pass a php string to a javascript variable
- get shortcode value
- Show price with Geo IP location
- WordPress Ajax Callback
- Add category to body class
- The called constructor method for WP_Widget in GFWidget is deprecated since version 4.3.0! Use
- How to review WordPress website php version compatibility?
- printf – problem to understand code
- Custom Post Type Plugin not loading category template and loading 404 instead