mysqli_real_escape_string() expects parameter 1 to be mysqli

$con=mysqli_connect("xxx","xxx","xxx","xxx");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
 }
// pass $con to mysqli_escape_string() function 
$name = mysqli_real_escape_string(trim($_POST["name"]), $con);

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
warning mysqli_real_escape_string() expects parameter 1 to be mysqli null given in Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, object given in C:\xampp\htdocs\LeMeuble_webmaster\htdocs\connexion\register.php on line 12 Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in Mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given codeigniter Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in mysqli_escape_string() expects parameter 1 to be mysqli, null given mysqli_real_escape_string() expects exactly 2 arguments, mysqli_real_escape_string() expects parameter 2 to be string mysqli_real_escape_string() expects parameter 1 to be mysqli string given mysqli_real_escape_string() expects exactly 2 parameters 1 given Message: mysqli::real_escape_string() expects parameter 1 to be string, object given mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given mysqli_real_escape_string() expects exactly 2 arguments, 1 given mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in mysqli_real_escape_string() expects parameter 1 to be mysqli, null given php Uncaught ArgumentCountError: mysqli_real_escape_string() expects exactly 2 arguments, mysqli_real_escape_string() expects exactly 2 parameters, 1 given in mysqli_real_escape_string() expects parameter 1 to be mysqli, object given in mysqli_real_escape_string() expects exactly 2 arguments, 1 given in mysqli_real_escape_string() expects exactly 2 parameters, 1 given mysqli_real_escape_string() expects parameter 1 to be mysqli Warning: mysqli_real_escape_string() expects exactly 2 parameters, mysqli_real_escape_string() expects exactly 2 arguments mysqli_real_escape_string() expects exactly 2 parameters
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source