Im trying to insert a file into a table but im getting the following error with the code bellow:
Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given
here is my php code:
<?php
if(isset($_FILES['uploaded_file'])) {
// Make sure the file was sent without errors
if($_FILES['uploaded_file']['error'] == 0) {
$sql_connection = mysql_connect("localhost", "teste", "localhost");
mysql_select_db("skande5_form", $sql_connection);
$nameFile = mysqli_real_escape_string($_FILES['uploaded_file']['name']);
$mime = mysqli_real_escape_string($_FILES['uploaded_file']['type']);
$size = mysqli_real_escape_string($_FILES['uploaded_file']['size']);
$data = mysqli_real_escape_string(file_get_contents($_FILES ['uploaded_file']['tmp_name']));
does anyone know how to solve this problem?