View Single Post
Old 04-16-2005, 07:30 PM   #1 (permalink)
Buck_NAkie
Registered User
 
Join Date: Apr 2005
Posts: 4
Buck_NAkie is on a distinguished road
Question Please Help I need some help with MySql and PHP

Ok people I am new to programming so if this is really simple please don't laugh.


Hi All below you find a a chunk of code I need help finishing. What I am trying to do is get the total changes in one column called status. I can use the getICMSData to retrieve data then if I could get it to populate the $newcount then output to a .txt file. Right now my code works if I hard code a number into the $newcount. Idealy I would like to get that number from the my GetICMSData or if there is another way that is cool as well. If I am not clear please reply asking questions.

PHP Code:
<?
function CountDefUpdates ()
{
//GetICMSData

UpdateICMS("UPDATE desktops SET status = \"dupend\" WHERE status = \"installed\" AND spy_policy_index = 2",$link);

$newcount 

$file="count.txt";

$fh1=fopen($file,"r");
$count=fscanf($fh1,"%d");
fclose($fh1);

//echo $newcount;
//echo $count[0];

$fh=fopen($file,"w+");
$count[0]=$count[0]+$newcount;

fprintf($fh,"%d",$count[0]);
fclose($fh);

}
?>

Last edited by Buck_NAkie; 04-16-2005 at 07:55 PM.
Buck_NAkie is offline   Reply With Quote