There are a few solutions to your problem.
The way with MySQLi would be like this:
<?php
$connection = mysqli_connect('localhost', 'username', 'password', 'database');
To run database queries is also simple and nearly identical with the old way:
<?php
// Old way
mysql_query('CREATE TEMPORARY TABLE `table`', $connection);
// New way
mysqli_query($connection, 'CREATE TEMPORARY TABLE `table`');
Turn off all deprecated warnings including them from mysql_*:
<?php error_reporting(E_ALL ^ E_DEPRECATED);
The Exact file and line location which needs to be replaced is “/System/Startup.php > line: 2 ” error_reporting(E_All); replace with error_reporting(E_ALL ^ E_DEPRECATED);
Related Posts:
- Undefined function mysql_connect()
- MySQL column count doesn’t match value count at row 1 [closed]
- Fatal error: Call to undefined function mysql_connect()
- dbDelta support for FOREIGN KEY
- is it possible to run some php code within a wordpress page?
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- How to use update and delete query in wordpress
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- Custom SQL query to get List of posts with featured image url
- Does WordPress cache get_user_meta() results?
- Delete post revisions on post publish
- Using Echo in ShortCode – Stuck
- Problems migrating WordPress to localhost
- MySQL query performed 4 times inside loop
- Show only one post for each author ( Page loads too slow )
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- Update some database fields when post is saved
- Modern Tribe Calendar wp-query with meta query not working at all
- WP database error for comments_popup_link()
- sql query to put quotes around numbers in img tag
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- Insert all post IDs in new database table
- Is the outdated PHP mysql extension a requirement for WordPress 4.6?
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- Strange wordpress slowness
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Why is variable not working on custom sql query using wpdb?
- Get WooCommerce product details and transfer them to a custom DB table
- How can I export posts with featured images, without download them
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- What is a valid parent for get_terms()?
- WSoD being caused by this piece of code
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Update results, Before deleting the related category [closed]
- Sum the total amount of a specific product purchased per user and display in table
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- Weird 404 URL Problem – domain name being placed at end of urls
- database sent to a JSON file
- $wpdb->insert() does not Insert record in a table
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- WordPress Block developer from exporting Database via PHP
- php include not working in custom page
- Force Users To Relogin
- email alert for product availability
- Basic wpdb update question
- A $_POST should occur when submit form but is not?
- Pull MySQL data from multiple tables and merge into 1 PHP array
- How do I prepare strings for insertions as values into a MySQL table?
- Using CFDB7 vs Custom MySQL Database [closed]
- add category to posts with tag wordpress
- How can I Use 2 databases with one WordPress install
- Why won’t this wpdb get_results query return results?
- Adding data to custom wordpress database table
- select a single val though a table in wordpress
- populate select options from extra mysql table data
- Removal of all posts content in bulk, keeping the posts itself
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- How to store checkbox data for individual users?
- WordPress low speed after migrating to new host
- Get mysql data for Quick Edit panel
- AWS Lightsail WordPress – connect to database on instance using mysqli
- call to undefined function mysql_connect
- Usermeta data unserialize, extract and display in table in WordPress
- I can’t separate the array by commas
- Using wpdb to connect to a different database is not working
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- How can i limit the number of posts to the most recent 6 in my query?
- Insert data from form to database
- (Who to follow) Twitter widget
- Prepared DB Query from _POST array
- How can I display a query in a page?
- Include a custom field in mysql query
- How to properly send many mysql queries via php and what happens with ajax requests after they are sent?
- Conditional statement within WP SQL query
- Passed variable gets undefined variable error on insert on next page
- How to set up an auto delete post?
- WordPress upload images not displaying
- two wordpress sites, two themes, one database, same content
- how to check for wordpress Query errors
- MySQL database migration to WordPress
- Custom query_posts() parameter
- MySQL update text field with ‘
- Query Concatenation
- Display total count of products in orders of a specific order status
- How to get a database field value from a WordPress table? [closed]
- Error resetting database index using ALTER TABLE in $wpdb->query
- Can’t insert into a database wordpress
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax [closed]
- WordPress Query with meta_key and order by another meta_key