Hi guys
I need help...
I have two tables. Stock and Tracking.
The idea is that a Form is used to indicate stock coming in or out and store it in the Stock table This works. Also it adds data to the tracking table, which also works
The tracking table shows times and dates of who was adding or subtracting stock as well as when they last did a stock take.
I can get this all to work.
What I cannot get to work is the WHERE cf_id='1' part is. I have 15 stock items, but how do I load the form to replace the cf_id='1' with the cf_id of another item?
I have tried adding:
as well as cf_id='$ID'
I receive no errors, but i just get a blank. But if I put a cf_id='1' or cf_id='2' etc etc it shows the list...
The code I have been using is below....
I need help...
I have two tables. Stock and Tracking.
The idea is that a Form is used to indicate stock coming in or out and store it in the Stock table This works. Also it adds data to the tracking table, which also works
The tracking table shows times and dates of who was adding or subtracting stock as well as when they last did a stock take.
I can get this all to work.
What I cannot get to work is the WHERE cf_id='1' part is. I have 15 stock items, but how do I load the form to replace the cf_id='1' with the cf_id of another item?
I have tried adding:
$ID=$_POST['cf_id'];
as well as cf_id='$ID'
I receive no errors, but i just get a blank. But if I put a cf_id='1' or cf_id='2' etc etc it shows the list...
The code I have been using is below....
<?php
$db =& JFactory::getDBO();
$query = "
SELECT id, diff, cf_id, item, activity, user_drawn, user_stock_check, time_drawn, time_stock_check, drawing, actual FROM epr1i_stock_draw_tracking WHERE cf_id='1' ORDER BY cf_id DESC";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
echo "<option value=$row->cf_id>$row->time_drawn $row->time_stock_check $row->user_drawn $row->user_stock_check In/Out: $row->drawing $row->activity Counted: $row->actual Difference: $row->diff<br></option>";
}
?>