我试图将文件插入表中,但使用以下代码出现以下错误:
警告:mysqli_real_escape_string() 需要 2 个参数,1 个给定
这是我的php代码:
<?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']));
有谁知道如何解决这个问题?