| | |
New to PHP and MySQL and help bad!
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 3
Reputation:
Solved Threads: 0
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
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
![]() |
Similar Threads
- 250 MB Disk / 40 GB Traffic Free PHP & MySQL Host (Web Hosting Deals)
- configure PHP to work with Mysql (MySQL)
- PHP, ASP, ColdFusion, what's your fav? (IT Professionals' Lounge)
- How many clients can access a PHP script at a time from a MySQL server? (MySQL)
- Can't see MySql records using PHP with any browser (MySQL)
- Can't see mysql records using php in any browser (PHP)
- A Programmer's Introduction to PHP 4.0 (PHP)
Other Threads in the PHP Forum
- Previous Thread: Whats wrong with this code
- Next Thread: Contribute code
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





