Here is my code for update table:
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th>Date</th>
<th>Time</th>
<th>File</th>
<th>Image</th>
<th>Operation</th>
</tr>
</thead>
<?php
while($row = mysqli_fetch_assoc($data))
{
echo "<tr>
<td>".$row['Title']."</td>
<td>".$row['Description']."</td>
<td>".$row['Date']."</td>
<td>".$row['Time']."</td>
<td>".$row['File']."</td>
<td>".$row['Image']."</td>
<td><a href='uprownews.php?id=$row[id]'>Edit</a></td>
</tr>";
}
}
else {
echo "No Record Found";
}
?>
</table>
Below is the uprownews.php file. I'm facing one more issue in below code with not being able to update files (file & image) Note: Except files all data getting updated.
$conn=mysqli_connect($servername,$username,$password,$dbname);
$sql= " SELECT * FROM news ";
$records=mysqli_query($conn,$sql);
$row = mysqli_fetch_array($records);
echo "<form id=news_table action=uprownews.php method=post enctype=multipart/form-data>";
echo "<input type=hidden name=id value = '".$row['id']."'>";
echo "Title";
echo "<textarea name=title rows=2 cols=100> ".$row['Title']."</textarea><br><br>";
echo "Description ";
echo "<textarea name=description rows=20 cols=100>".$row['Description']."</textarea><br><br>";
echo "Date ";
echo "<input type=date name=date value = '".$row['Date']."'><br><br>";
echo "Time ";
echo "<input type=time name=time value = '".$row['Time']."'><br><br>";
echo "File ";
echo "<input type=file name=file>".$row['File']."<br><br>";
echo "Image ";
echo "<input type=file name=image>".$row['Image']."<br><br>";
echo "<input type=submit value=Update name=submit1 >";
echo "</form>";
Please guide me on how to do this.