The code below follows the database being open. I am trying to cycle through the records (Matching table ID with loop $i
I am doing this to get it working so I can then modify it to insert session variable values into the field Qty.
I tried using PhpMyAdmin to select a record manually, and entered a qty value, then got PHP code from the query it showed. Modified it hoping it would work but just plays dumb. Any pointers, and also does the query have to contain all the fields, can it not just contain the one I want to put a value in? thanks
$i=0;
while ($i < $num) {
$sql = 'UPDATE `template` SET `Location` = \'\', `OrderNumber` = \'\', `Caption` = \'\', `OrderDate` = NULL, `Group` = \'1\', `Description` = \'DBC-6M\', `FujiPartNumber` = \'P10W000028A\', `Duration` = \'6 mins\', `UnitPrice` = \'1.40\', `Qty` = \'100\', `OrdSubTotal` = \'0.00\', `RunningTotal` = \'0.00\' WHERE `ID` = $i;';
$i++;
}
mysql_close();
I am doing this to get it working so I can then modify it to insert session variable values into the field Qty.
I tried using PhpMyAdmin to select a record manually, and entered a qty value, then got PHP code from the query it showed. Modified it hoping it would work but just plays dumb. Any pointers, and also does the query have to contain all the fields, can it not just contain the one I want to put a value in? thanks
$i=0;
while ($i < $num) {
$sql = 'UPDATE `template` SET `Location` = \'\', `OrderNumber` = \'\', `Caption` = \'\', `OrderDate` = NULL, `Group` = \'1\', `Description` = \'DBC-6M\', `FujiPartNumber` = \'P10W000028A\', `Duration` = \'6 mins\', `UnitPrice` = \'1.40\', `Qty` = \'100\', `OrdSubTotal` = \'0.00\', `RunningTotal` = \'0.00\' WHERE `ID` = $i;';
$i++;
}
mysql_close();