Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:21:35+00:00 2026-05-16T17:21:35+00:00

I have a count field in a table that I need to increment and

  • 0

I have a count field in a table that I need to increment and this is what I have.

$click_tracker_row = mysql_fetch_array($result);
$current_count = $click_tracker_row['count'];
$new_count = $current_count + 1;
$query_wiki ="UPDATE click_tracker  SET count = '{$new_count}' WHERE click_tracker_id = '{$click_tracker_row['click_tracker_id']}' LIMIT 1";                 
$result = mysql_query($query) ;

But it never changes….is there a better way of doing this and why is this not working
count is an integer field

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:21:36+00:00Added an answer on May 16, 2026 at 5:21 pm

    You should simply update this counter using SQL and use PHP’s mysql_real_escape_string()-function to prevent SQL injection:

    $query_wiki ="UPDATE click_tracker SET count = count + 1 WHERE click_tracker_id = '".mysql_real_escape_string($click_tracker_row['click_tracker_id'])."' LIMIT 1";
    

    Furthermore, there is a typo in your mysql_query()-call. You will need to pass $query_wiki to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a measure, that's a distinct count on a field in the fact
I have a workDate field and a receivedDate field in table tblExceptions. I need
I have a mysql table that contains a date field in epoch time format.
I have a log table with a date field called logTime. I need to
I have a table that i wanted to create some charts. Basically i need
I have this kind of simple query that returns a not null integer field
Basically, I have a field in my table that shows when the latest activity
Now I want to update table. Assumes that, I have PurchaseOrder and PurchaseOrderDetails. I
i have a table which has many fields but i want to get count
In my class, I have field int count . I want to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.