Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

way to avoid update field "Timestmp" by jump.cgi?

Quote Reply
way to avoid update field "Timestmp" by jump.cgi?
 
Hi,

"build changed" builds all links with a Timstamp >= time of the last build.

Every click on a link updates the Filed "Timstamp" in table "Links".

Is there a way the aovid MySQL/LinksSQL to update the field "Timestamp" by clicks on a link.

We have 2.000 clicks on the links of our Site and do not need to build 2.000 detailed pages every hour just because the clicks have changed.

Ok, i can uncommend the update-query in the jump.cgi but this is quick an (very) dirty ;-)

Any ideas?

Oliver
Quote Reply
Re: [flasi] way to avoid update field "Timestmp" by jump.cgi? In reply to
Commenting out is probably your best bet...

Make sure you do a full rebuild though every day or so, otherwise lots of pages will stay un-changed, even when the hit counter etc has gone up...

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] way to avoid update field "Timestmp" by jump.cgi? In reply to
 
Hi Andy,

i find a way:

$db->update ( { Hits => \"Hits + 1", Timestmp => \"Timestmp" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );

This updates the Timestamp with the selected same Timestamp - without changes.

Oliver
Quote Reply
Re: [flasi] way to avoid update field "Timestmp" by jump.cgi? In reply to
Hey, does this work? Really?

Timestamp is an automatically updated field by the database engine, which marks the last time a record was altered, and it just seems odd to be able to do that ;) So much for security with applications. Probably one reason MySQL doesn't support transaction rollbacks. Wonder how they are going to get around this with the future versions.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [flasi] way to avoid update field "Timestmp" by jump.cgi? In reply to
Hi,

The reason for this is because the Hits column has changed, so Build Changed needs to rebuild those pages that have new Hits. If this isn't important, the trick you mentioned works great.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] way to avoid update field "Timestmp" by jump.cgi? In reply to
Wouldn't removing Timestmp => \"Timestmp" do the same job as updating the column with itself?

Last edited by:

Paul: Sep 25, 2002, 10:27 AM
Quote Reply
Re: [Paul] way to avoid update field "Timestmp" by jump.cgi? In reply to
No, as Timestamp columns in MySQL get automatically updated to NOW() whenever the row is changed. See:

http://www.mysql.com/doc/en/DATETIME.html

for more info. Links SQL uses this column to see what has changed since the last build to know which pages need re-generating.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] way to avoid update field "Timestmp" by jump.cgi? In reply to
Ok I wasn't thinking...so including it in the update overwrites the default?

I didn't get to bed until 5am this morning due to a problem with one of my cats so I am so brain dead today :(