title: Insert and display Barcode in PHP / MySql
body: <p>I have a form where i <strong>scan my barcode</strong></p>
  
  <blockquote>
    <p>form_insert.php</p>
  </blockquote>
  
  <pre><code>&lt;form action="stock_insert.php" method="get"&gt;
          &lt;input type="text" name="barcode" placeholder="Εισαγωγή BarCode"&gt; &lt;br&gt;
          &lt;input type="submit" name="SAVE" 
  &lt;/form&gt;
  </code></pre>
  
  <p>Insert it in my database</p>
  
  <blockquote>
    <p>stock_insert.php</p>
  </blockquote>
  
  <pre><code>&lt;?php
  include_once  'database_connection.php';
  $barcode = $_GET['barcode'];
  $sql = "INSERT INTO stock(barcode) VALUES ('$barcode');";
  mysqli_query($conn, $sql);
  header('Location: form_insert.php?signup=success');
  ?&gt;
  </code></pre>
  
  <p>When i'm scanning my barcode the number that i show  is  <em>008576124045</em></p>
  
  <p>But in my  database the  number is saved as <em>2147483647</em></p>
  
  <p>After that  when i want to scan again and display my barcode like this:</p>
  
  <blockquote>
    <p>test.php</p>
  </blockquote>
  
  <pre><code>&lt;script&gt;
          $(document).ready(function(){ 
              $("#submit").click(function(){
                  var barcode =  $("#kwdikos").val();
                  $.post("database/ajax.php", 
                  {
                      barcode: barcode ,
                      value: value
                  },function(data){
                      $("#test").html(data);          
                  });
             });
          });
      &lt;/script&gt; 
          &lt;input type="text"   id="kwdikos" placeholder="Εισαγωγή  BarCode"&gt;
          &lt;input type="submit" id="submit" name="add" value="Προσθήκη"&gt;
  </code></pre>
  
  <blockquote>
    <p>ajax.php</p>
  </blockquote>
  
  <pre><code>&lt;?php
  $barcode = $_POST['barcode'];
  $sql_get = "SELECT * FROM stock WHERE barcode ='$barcode' ";
  $result = mysqli_query($conn, $sql_get);      
          $resultCheck = mysqli_num_rows($result);
          if ($resultCheck &gt; 0) {
              while  ($row = mysqli_fetch_assoc($result)){
                      $name = $row['name'];
                      $color = $row['color'];
                      $kind = $row ['kind'];
                      $price = $row['price'];
              }}
  $sql = "INSERT INTO receipt (barcode, name, color, kind, value , price) VALUES ('{$barcode}','{$name}','{$color}','{$kind}','{$value}' , '{$price}')";
  mysqli_query($conn, $sql);
  ?&gt;
  &lt;table class="table table-dark"&gt;  
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;td&gt;BarCode&lt;/th&gt;
                  &lt;td&gt;Ονομασία&lt;/th&gt;
                  &lt;td&gt;Χρώμα&lt;/th&gt;
                  &lt;td&gt;Είδος&lt;/th&gt;
                  &lt;td&gt;Ποσότητα&lt;/td&gt;
                  &lt;td&gt;Τιμή&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;         
          &lt;tbody&gt;
                   &lt;?php 
                          $sql = "SELECT * FROM receipt ";
                          $result = mysqli_query($conn, $sql);      
                          $resultCheck = mysqli_num_rows($result);
                          if ($resultCheck &gt; 0) {
                              while  ($row = mysqli_fetch_assoc($result)){
                      ?&gt;
              &lt;tr&gt;    
                  &lt;td&gt;&lt;?php echo $row['barcode']; ?&gt; &lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['name']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['color']; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['kind'];?&gt;&lt;/td&gt; 
                  &lt;td&gt;&lt;?php echo $row['value'];?&gt; &lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['price'];
                  echo "€";?&gt;&lt;/td&gt;      
              &lt;/tr&gt;   
                         &lt;?php }} ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>When i scan ones again the number the input is  (008576124045)</p>
  
  <p>My screen displays the RIGHT number that is saved in database (2147483647)</p>
  
  <p>But  all the other stuff that are want to display DON'T DISPLAY!</p>
  
  <p><strong>When i  dont use barcode , but in my input i write  a  number  with my keyboard (for example: 10500 ) i have no problem with my code. It is running  perfectly and  all stuffs in database are correct.</strong></p>