title: SQL Query doesn't update database in phpmyadmin
body: <p>I'm new to php and MySQL and I'm currently trying to build a small website as a practice. I have this small error where I want to edit the payment in my database, the code runs and it says it's successful but it doesn't update in the table. I tried using a lot of different ways like creating views in my database but it still didn't work. The php page is supposed to get the user_id from the previous page and this works well, but it still doesn't update the table.</p>
  
  <p>Here is the sql for my basket table:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `basket` (
  
  
  `product_id` int(8) NOT NULL,
    `user_id` tinyint(4) NOT NULL,
    `quantity` mediumint(8) NOT NULL,
    `size` varchar(150) NOT NULL,
    `payment` varchar(6) NOT NULL default 'No',
    `checkout` varchar(3) NOT NULL default 'No'
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `basket`
  --
  
  INSERT INTO `basket` (`product_id`, `user_id`, `quantity`, `size`, `payment`, `checkout`) VALUES
  (1, 1, 1, 'Small', 'No', 'Yes'),
  (3, 1, 1, 'Small', 'No', 'Yes'),
  (20, 1, 1, 'Small', 'No', 'Yes'),
  (3, 2, 1, 'Small', 'Yes', 'Yes');
  </code></pre>
  
  <p>Below is my php code as I'm using the view called payment_details in my database:</p>
  
  <pre><code>&lt;?php
  require_once('my_connect.php');
  require_once 'header.php';
  $user_id=$_GET["user_id"];?&gt;
  
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;H1&gt;Edit Payment Form&lt;/H1&gt;
  &lt;table&gt;
  
  &lt;?php
  if (isset($_POST['change_payment'])): 
          $user_id=$_GET["user_id"];
          $payment=$_POST["payment"];
  
          $edit_query= "update basket set 
                          payment = '$payment' where 
                          user_id='$user_id'"; 
  
          $edit_result= mysqli_query($connection, $edit_query);
  
          if ($edit_result) :
                  header ('location: view_orders.php?confirm=Product item successfully updated');
          else :
                  echo "&lt;b&gt;This didn`t work, error: &lt;/b&gt;";
                  echo mysqli_error($connection);
          endif;
      endif;
  
  
      $user_id=$_GET['user_id']; 
      $my_query="select * from basket where user_id=$user_id;"; 
      $result= mysqli_query($connection, $my_query);
  
      while ($myrow = mysqli_fetch_array($result)):
          $user_id= $myrow['user_id'];
          $payment = $myrow["payment"];
      endwhile;
  
      echo "&lt;form method='POST' action='change_payment.php' &gt;
          &lt;tr&gt;&lt;td&gt;&lt;b&gt;Payment:&lt;/b&gt;
          &lt;td&gt;&lt;input type='text' name='payment' value='$payment'&gt; 
          &lt;tr&gt;&lt;td&gt;&lt;input type='submit' name='change_payment' value='Save Changes'&gt;
          &lt;/form&gt;";
  ?&gt;
  
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/div&gt;
  &lt;?php require_once('footer.php'); ?&gt;
  </code></pre>
  
  <p>It doesn't update the basket table in my database and I wanna know why? Please help my with this and I'll be thankful.</p>