PHP and MYSQL help needed

trying to get output to a text file

Page 1 of 1

1 Replies - 1381 Views - Last Post: 17 April 2005 - 10:14 AM Rate Topic: -----

#1 bucknakie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-March 05

PHP and MYSQL help needed

Posted 17 April 2005 - 09:15 AM

Hi all,

In the code below what I am trying to do and failing at is.
1st get data to find the newcount then take new count ad output it to a text file. Any help and I will be in your debt.

function CountDefUpdates ()
{
$newcount = GetICMSData ("SELECT COUNT(*) FROM desktops WHERE status=\"installed\"",$link);

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

$newcount =(10);

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

}

Is This A Good Question/Topic? 0
  • +

Replies To: PHP and MYSQL help needed

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: PHP and MYSQL help needed

Posted 17 April 2005 - 10:14 AM

Can you be more specific about the problem? Is the query not returning the right results? Is it not writing to the file? You're also calling a couple of functions that are not defined here, so it's a little hard to tell if that's where the problem might be. If you could specify in which way the code is not performing to your expectations, it would be most appreciated.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1