Hi guys you might know this about qr code im just a newbie here, my problem is that i can't produce simple qrcode that will fetch the data through the database , i wanted to create a single row of database and display it as a qrcode, can you help me?
here's my code so far
<?php
include "qrlib.php";
include "includes/config.php";
$con = mysql_connect('localhost','root','');
mysql_select_db('oswa_inv', $con);
$result = mysql_query( 'SELECT * FROM products WHERE id = `id`');
//set it to writable location, a place for temp generated PNG files
$PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
//html PNG location prefix
$PNG_WEB_DIR = 'temp/';
//ofcourse we need rights to create temp dir
if (!file_exists($PNG_TEMP_DIR))
mkdir($PNG_TEMP_DIR);
$filename = $PNG_TEMP_DIR.'test.png';
while ($row = mysql_fetch_assoc($result))
{
$filename = ''.$row['name'].$row['serial_number'].$row['model'].$row['description'].$row['location'].'';
echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" /><hr/>';
}
?>
rheiniel 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
rheiniel 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
rheiniel 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.