Jump to content

Ronaldmi

New Members
  • Posts

    2
  • Joined

  • Last visited

Ronaldmi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So, what would be the recommend way to execute the query and output?
  2. I having an issue with a query output where is only outputing one product instead of all the products matching WHERE shelf='KDR'. Here is the code <?php include_once('../../header.php'); ?> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/highcharts-3d.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <script type="text/javascript"> $(function () { $('#KDR').highcharts({ chart: { type: 'pie', options3d: { enabled: true, alpha: 45 } }, title: { text: 'Current Inventory' }, plotOptions: { pie: { innerSize: 100, depth: 45 } }, series: [{ name: 'In Stock', data: [ <?php $query_products = mysql_query("SELECT * FROM product, product_amount WHERE shelf='KDR'"); while($list_products = mysql_fetch_assoc($query_products)) { $products['id'] = $list_products['id']; $products['status'] = $list_products['status']; $products['code'] = $list_products['code']; $products['name'] = $list_products['name']; $products['amount'] = $list_products['amount']; $dump = array(); } $result1= $products['name']; $result2= $products['amount'] ?> ['<?php echo $result1?>', <?php echo $result2?>], ] }] }); }); </script> <div class="row"> <H1>KDR</H1> <div id="KDR" style="width:50%; height:400px;"> </div> </div> <?php include_once('../../footer.php'); ?> he querry appears to work, but when I echo the result I get: ['product 1 name', 'product 1 amount' ], instead of : ['product 1 name', 'product 1 amount' ], ['product 2 name', 'product 2 amount' ], ['product 3 name', 'product 3 amount' ], ['product 4 name', 'product 4 amount' ], ['product 5 name', 'product 5 amount' ], ['product 6 name', 'product 6 amount' ], attached are images of the tables structure any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.