RE: Updating count on record results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this is how I did it for a client's site

// update the number of times the vehicle has been viewed
mysql_db_query($dbname, "UPDATE vehicle_inventory SET viewed=viewed+1 WHERE ccode='$ccode'", $link);



bastien

From: Stuart Felenstein <stuart4m@xxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  Updating count on record results
Date: Fri, 19 Nov 2004 04:59:20 -0800 (PST)

I am setting up a table to log a count on individual
records for every time they are returned in a results
return.

Just so to illustrate

Record1

First search brings up Record1 (counter is set too 1)
Second search brings up Record1 (counter is set too 2)
Third search brings up Record1 (counter is set too 3)
...etc.

So I have a vauge idea of the sql statement but where
to place is the question. My thoughts are that it
should be in the loop that generates the result rows
return.  In other words -

Maybe here :
<?php echo $row_rsVJ['JobTitle']; ?></div></td>

Or maybe here ?:
<?php } while ($row_rsVJ = mysql_fetch_assoc($rsVJ));
?>

Hope what I'm asking is clear.

Thank you ,
Stuart

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux