<?php$con = mysqli_connect(“localhost”,”my_user”,”my_password”,”my_db”);// Check connectionif (mysqli_connect_errno()) { echo “Failed to connect to MySQL: ” . mysqli_connect_error();}if ($_SERVER[“REQUEST_METHOD”] == “POST”) { //unsafe data $unsafe_name = mysqli_real_escape_string($con, […]
How to connect to mysqli database in php?
Create connection.php file and include all CRUD operation’s file for connect database. <?phperror_reporting(0);$DB_HOST = ‘localhost’;$DB_USER = ‘root’; $DB_PASS = ”;$DB_NAME = ‘mysql’;$conn = mysqli_connect($DB_HOST,$DB_USER,$DB_PASS,$DB_NAME);// Check […]
How to Replace Text of the_content in WordPress
If you want to replace keywords and text in the_content? Add the following code to the functions.php file of your WordPress active theme OR in […]