I make search function in one php file. but after i separate them my coding show undefined index. Any can help me to solve this error the undefine index for the full_name not string
<?php
if ($_REQUEST["string"]<>'') {
$search_string = " AND (file_name LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%')";
}
if ($_REQUEST["file_name"]<>''){
$sql = "SELECT * FROM file WHERE file_name'".mysql_real_escape_string($_REQUEST["file_name"])."'".$search_string;
}
else {
$sql = "SELECT * FROM file WHERE file_id>0 ".$search_string;
}
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$id=$row['file_id']?>
<tr>
<td><?php echo $row["file_id"]; ?></td>
<td><?php echo $row["file_reference"]; ?></td>
<td><?php echo $row["file_name"]; ?></td>
<td><?php echo $row["file_location"]; ?></td>
<td><?php echo $row["file_pdf"]; ?></td>
</tr>
<?php
}
} else {
?>
<tr><td colspan="5">No results found.</td>
<?php
}
?>
any suggestion to solve undefined error on my coding.