dear Friend my query working and updating feildes but as i ask to update with a seeking of one record its not work query is
$custno=2100;
$date1 = "2004/08/23";
$date2 = "2004/08/29";
$handle = @fopen("http://localhost/unitscustomerspecie.php?cust=".$custno, "rb");
$contents = "";
//print $handle;
if($handle)
{
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
// print $contents;
} while (true);
fclose($handle);
$contents=trim($contents,"@@");
//print "" .$contents. "CONTENTS OF SLPROJ";
$temp=explode("@@",$contents);
//print count($temp). "count test";
//print "<b>temp: </b>".$temp[0]."<p>";
for($zzz=0;$zzz < count($temp); $zzz++)
{
$temp3=explode("",$temp[$zzz]);
$units[]=$temp3[0];
$Customer[]=$temp3[1];
$speciecode[]=$temp3[2];
print "<p><b>UNITS</b>".$units[$zzz]."><p>";
print "<b>CUSTOMER</b>".$Customer[$zzz]."<p>";
print "<b>SPECIECODE</b>".$speciecode[$zzz]."<p>";
print "UPDATE tblReport Set BudgetUnits=".$units[$zzz]." WHERE specieCode=".$speciecode[$zzz];
// $res_units=mysql_query("UPDATE tblReport Set BudgetUnits = ".$units[$zzz]." WHERE specieCode = ".$speciecode[$zzz]."");
$res_units = "UPDATE tblReport Set BudgetUnits=".$units[$zzz]." WHERE specieCode=".$speciecode[$zzz];
$result5=mysql_query($res_units)or die("could not Update Records");
// $res_units=mysql_query("UPDATE tblReport Set BudgetUnits = 200 WHERE specieCode = 32");
//$res_units="UPDATE tblReport Set BudgetUnits = ".$units[$zzz]." where specieCode = ".$speciecode[$zzz];
}
}
?>
when i execute this page i see these massage
UNITS45>
CUSTOMER2100
SPECIECODE32
UPDATE tblReport Set BudgetUnits=45 WHERE specieCode=32
UNITS197>
CUSTOMER2100
SPECIECODE34
UPDATE tblReport Set BudgetUnits=197 WHERE specieCode=34
UNITS65>
CUSTOMER2100
SPECIECODE35
UPDATE tblReport Set BudgetUnits=65 WHERE specieCode=35
UNITS80>
CUSTOMER2100
SPECIECODE38
UPDATE tblReport Set BudgetUnits=80 WHERE specieCode=38
UNITS69>
CUSTOMER2100
SPECIECODE39
UPDATE tblReport Set BudgetUnits=69 WHERE specieCode=39
UNITS3>
CUSTOMER2100
SPECIECODE43
UPDATE tblReport Set BudgetUnits=3 WHERE specieCode=43
UNITS25>
CUSTOMER2100
SPECIECODE44
UPDATE tblReport Set BudgetUnits=25 WHERE specieCode=44
UNITS19>
CUSTOMER2100
SPECIECODE45
but when i see the result from database directly its no ok it update BudgetUnits but put the value in starting feilds not seeking the specieCode ..... so its totaly wrong result to mee please guid me
like above result
UNITS45>
CUSTOMER2100
SPECIECODE32
in database abainst speciecode 32 thier must be Units 45 but in database thier is nothing unints against 32 spepciecode
and look this one
UNITS80>
CUSTOMER2100
SPECIECODE38
UNITS69>
CUSTOMER2100
SPECIECODE39
against speciecode 38 in databsae thier must be 80 units but thier is 39 and thier is nothig againt 39 specicode
i am confuse much what is this and where it is going???
Pleas Guid me