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 mysql table that contains a date field in epoch time format.
I have a table like as follows: SoftwareName Count Country Project 15 Canada Visio
I have a SQL statement similar to this: SELECT COUNT(*) AS foo, SUM(foo) AS
I have the following query: select column_name, count(column_name) from table group by column_name having
I have the following code: SELECT <column>, count(*) FROM <table> GROUP BY <column> HAVING
I have a series of dynamically generated inputs that I need to have ajax
I have a vector with 1000 nodes if(count + 1 > m_listItems.capacity()) m_listItems.reserve(count +
I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1
I have the following string expression in a PowerShell script: select count(*) cnt from
I have the following C++ method : __declspec(dllexport) void __stdcall getDoubles(int *count, double **values);

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.