buck_nakie 0 Newbie Poster

Hi all,

I am learning to write with PHP and am stuck and need some wise souls help.
In a nutshell I need to be able to take grab a DB coulmn status and then count how many times it gets updated and output that number to a file and then have that number add to what the number was before. I have every thing working but getting the number. Here is the bit of code I have so far so it will be easier to figure what I need

function CountDefUpdates ()
{
//GetICMSData

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

$newcount = mysql_query ("SELECT

$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);

thanks for looking

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.