![]() |
|
#1
|
|||
|
|||
update setI have put a counter onto my news page to record how many times each article (recalled from database) has been read. However it doesnt work
I am using PHP Code:
If so can anybody help in pointing me in the right direction of what I may me doing wrong. A bit vague I know but all the recalls work ok. |
|||
|
#2
|
||||
|
||||
|
Quote:
Sorry misunderstood, I was testing some new changes to the board and didn't notice this thread you started. Anyway, it doesn't look that it was ignored for very long... Anyway, try: PHP Code:
That's another reason why I like to surround my db / table / field names with backticks - you can pick out typos easily! __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
I think I will have to give you more code because I still cant get it to work. I think I have mixed my code somewhere but just cant see it.
The first section works but the second section doesnt. Am I mixing things? PHP Code:
|
|
#4
|
||||
|
||||
|
OK, I see the problem:
Quote:
Anyway, it seems to me that all you want to do, out of this bit of code, is to update the counter by ONE right? Then you can disable every line in your sample code above and just edit that last line like this: PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#5
|
|||
|
|||
|
Thanks JDS that works now
I swapped it around a little to PHP Code:
I have another question similar to this but I will read the php manual again to see if I can work it out. ![]() |
|
#6
|
||||
|
||||
|
When I said this in my last post:
Quote:
What I actually meant to say is this: Quote:
I welcome your questions and no I will not expect you to RTFM before you ask your questions here. This applies to anyone and everyone. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#7
|
|||
|
|||
|
One problem solved generates another :-(
Can I get my timestamp to ignore the counter column. It now shows posted on the time the visitor clicks the news item :-( Can I alter the timestamp to only work from my admin and not the news page? It only took me half an hour to notice |
|
#8
|
||||
|
||||
|
FWIW, I don't think the code we discussed in this thread is the cause of the timestamp being updated as well. It must be some other update query further down in your script thats doing this..
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#9
|
|||
|
|||
|
Managed to sort the problem out by adding a counter table that had the id for my news inserted into the counter table when I added a new news item. I now update the counter table when the newsid matches the id in the counter table. My timestamp is still in the news table and isnt affected.
I am sure you have done an article on this now I think about it. |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Google Update and DeepCrawl Alert | JdS | Search Engine Optimization Forum | 24 | 16-Aug-2003 06:35 |
| update problem | zuzupus | MySQL / PHP Forum | 2 | 15-Aug-2003 08:00 |
| Google update imminent? | JdS | Search Engine Optimization Forum | 2 | 08-Aug-2003 11:08 |
| The Google update this time... | JdS | Search Engine Optimization Forum | 5 | 04-Jun-2003 16:25 |
| Analyzing the March Google update | jrobbio | Search Engine Optimization Forum | 3 | 12-Mar-2003 19:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The