RE: Updating count on record results

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

 



its a separate query on the same page, its activated after the data retreival query runs.

<?
...
// get the information for this vehicle
$result = mysql_db_query($dbname, "SELECT * FROM vehicle_inventory WHERE ccode='$ccode'", $link);
$data = mysql_fetch_array($result);
$data[comments] = nl2br($data[comments]);


// 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: Bastien Koert <bastien_k@xxxxxxxxxxx>, php-db@xxxxxxxxxxxxx
Subject: RE:  Updating count on record results
Date: Fri, 19 Nov 2004 07:28:48 -0800 (PST)


--- Bastien Koert <bastien_k@xxxxxxxxxxx> wrote:

> 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);
>
Where did this code go though ? Meaning, was it in a
seperate script / page or was it part of a bigger
query that first got the results based on certain
criteria , the did the update?

Stuart

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