Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,461 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,361 people online right now. Registration is fast and FREE... Join Now!




PHP and MYSQL help needed

 
Reply to this topicStart new topic

PHP and MYSQL help needed, trying to get output to a text file

bucknakie
post 17 Apr, 2005 - 08:15 AM
Post #1


New D.I.C Head

*
Joined: 25 Mar, 2005
Posts: 3

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

}
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 17 Apr, 2005 - 09:14 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,173



Thanked 33 times

Dream Kudos: 25
My Contributions


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.
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 12:32PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month