Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 警告:mysql\u real\u escape\u string()要求参数1为字符串_Php_Html - Fatal编程技术网

Php 警告:mysql\u real\u escape\u string()要求参数1为字符串

Php 警告:mysql\u real\u escape\u string()要求参数1为字符串,php,html,Php,Html,HTML代码 <tr> <td><input type="text" name="batch_code[]" required="required" value="<?php if(isset($batch_code[0]))echo htmlentities($batch_code[0]); ?>"/></td> <td><input type="text" name="description[

HTML代码

<tr>
   <td><input type="text" name="batch_code[]" required="required" value="<?php      if(isset($batch_code[0]))echo htmlentities($batch_code[0]); ?>"/></td>
   <td><input type="text" name="description[]" value="<?php if(isset($description[0]))echo htmlentities($description[0]); ?>"/></td>
   <td><input type="text" name="current_value[]" value="<?php if(isset($current_value[0]))echo htmlentities($current_value[0]); ?>"/></td>
   <td><input type="text" size="12" name="qty[]"  required="required"  value="<?php if(isset($qty[0]))echo htmlentities($qty[0]); ?>"/></td>
   <td><select id="asset_id" class="asset_id" name="asset_id[0][]" multiple="multiple" required>
    <?php foreach($asset_ids as $asset_id): ?>
            <option class="dropdownlist"><?php echo $asset_id->asset_id; ?></option> 
     <?php endforeach; ?>
    </select></td>
</tr>
<tr>
   <td><input type="text" name="batch_code[]" required="required" value="<?php      if(isset($batch_code[1]))echo htmlentities($batch_code[1]); ?>"/></td>
   <td><input type="text" name="description[]" value="<?php if(isset($description[1]))echo htmlentities($description[1]); ?>"/></td>
   <td><input type="text" name="current_value[]" value="<?php if(isset($current_value[1]))echo htmlentities($current_value[1]); ?>"/></td>
   <td><input type="text" size="12" name="qty[]"  required="required"  value="<?php if(isset($qty[1]))echo htmlentities($qty[1]); ?>"/></td>
   <td><select id="asset_id" class="asset_id" name="asset_id[1][]" multiple="multiple" required>
    <?php foreach($asset_ids as $asset_id): ?>
            <option class="dropdownlist"><?php echo $asset_id->asset_id; ?></option> 
     <?php endforeach; ?>
    </select></td>
</tr>
如何修复此错误?

而不是使用

if( $this->real_escape_string ) { // PHP v4.3.0 or higher
使用检查php版本

phpversion()


你真的需要支持古老的PHP4版本吗?!如果您使用这些,SQL注入是您的问题中最小的。。。
if( $this->real_escape_string ) { // PHP v4.3.0 or higher
phpversion()
function_exists('real_escape_string')