Iam trying to update a table using where clause, but the query updates all the rows to the same result (image) in the image column:
<form action="" method="POST">
<input type="text" name="fname" value="<?php echo $items['firstname']?>"/><br>
</form>
$image =addslashes(file_get_contents($_FILES['webcam']['tmp_name']));
$sql ="update employee set image='$image' where firstname LIKE '%".$_POST['fname']."%'";
When I try: 'where firstname= ‘firstname’ ’ (just for testing)an exiting user then it works fine. The problem is when I try to put the input value: 'firstname LIKE ‘%".$_POST[‘fname’]."%’";