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 6220485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:57:52+00:00 2026-05-24T07:57:52+00:00

I am experiencing a strange problem with a simple query that returned the number

  • 0

I am experiencing a strange problem with a simple query that returned the number of rows in a table.

This was always working fine and correct.

However! Yesterday I added a new function to my website that updates a column in existing rows in my table. This function called add_file()

Now my website is giving a wrong value of what it should be:

Currently there are 76 rows in my table called “procedure” viewed from phpMyadmin and SQLyog.

However in my website it is saying there are 70.

Machines DO NOT LIE, so this is most likely my doing

I have a hunch that my function called add_file() is to blame.

What this function does is update the “edocument” column in my procedure table if a user uploads a file corresponding to that record. So that the system knows what that file is called and can construct a url for it.

        public function add_filename($file)
        {

            //This is the extension of the file retrieved from an array
            $extension = $file['upload_data']['file_ext'];


            //variable for updating row which is constructed from Username+Filename+Extension
            $filename = array
            (
                'edocument' => ($this->session->userdata('name').$this->input->post('record_id')).$extension
            );

            //find row that matches the row just submitted by user
            $this->db->where('procedure_id',$this->input->post('record_id'));
            //update that row with the filename of the document uploaded
            $this->db->update('procedure', $filename); 

        }

If you look at this screenshot you will see my “edocument” column from 72-76 has values.

https://i.stack.imgur.com/nxDnE.jpg

So is the update function breaking my database?

Thanks

  • 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-24T07:57:54+00:00Added an answer on May 24, 2026 at 7:57 am

    Are you sure that there are 76 rows?
    I see in your picture column patient_id, I guess it is auto increment (or at least it is linked with patients table that have auto increment primary key).
    But if you had run some DELETE queries you see only 70 rows, but the auto increment id will start from the last used number (from 76 in your case).

    Have you tried running simple COUNT query (without using codeigniter active record)? If yes, what was the result?

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

Sidebar

Related Questions

I'm new to Drupal and am experiencing this strange problem with my testing Drupal
I'm experiencing a strange problem in IE with an ajax request. It works fine
I'm experiencing a rather strange problem with foreign keys, namely this doesn't work as
I am experiencing a strange problem with asp.net forms authentication. This problem only occurs
We are experiencing a strange problem. We have a number of dev machines and
I am experiencing a strange problem: I have a Screen that is using the
I'm experiencing a strange problem when trying to count the entities in a managed
I am experiencing a strange behaviour of my application in Chrome browser (No problem
I'm experiencing something really strange! I have a div that I'm hiding with JS
Experiencing jquery in rails through .js.erb templates; but completely puzzled by a simple problem

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.