title: Save barcode in database
body: <p>I was wondering if I could save bar code in database.
  I am using "Code 39" type of barcode. Barcode will be generated from variable. I wanted to save it to database if possible. I have downloaded library from "<a href="http://www.barcodebakery.com" rel="nofollow">http://www.barcodebakery.com</a>". Can anyone give me suggestion how to do so?</p>
  
  <p>Code works fine it displays the image, later on I will use bar code scanner to look for products, each of them will contain bar code. </p>
  
  <pre><code>&lt;?php
      require_once('class/BCGFontFile.php');
      require_once('class/BCGColor.php');
      require_once('class/BCGDrawing.php');
      require('class/BCGcode39.barcode.php');
  
      $font = new BCGFontFile('font/Arial.ttf', 18);
      $color_black = new BCGColor(0, 0, 0);
      $color_white = new BCGColor(255, 255, 255);
  
      $barcode="3RC402A00";
  
      // Barcode Part
      $code = new BCGcode39();
      $code-&gt;setScale(2);
      $code-&gt;setThickness(30);
      $code-&gt;setForegroundColor($color_black);
      $code-&gt;setBackgroundColor($color_white);
      $code-&gt;setFont($font);
      $code-&gt;parse($barcode);
  
      // Drawing Part
      $drawing = new BCGDrawing('', $color_white);
      $drawing-&gt;setBarcode($code);
      $drawing-&gt;draw();
      header('Content-Type: image/png');
      $drawing-&gt;finish(BCGDrawing::IMG_FORMAT_PNG);
  ?&gt;
  </code></pre>
  
  <p>Any suggestion is appreciated.
  Thanks</p>