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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:39:00+00:00 2026-05-24T15:39:00+00:00

I got a pretty large DB-Table that I need to split into smaller tables

  • 0

I got a pretty large DB-Table that I need to split into smaller tables for different reasons.

The handling happens via php close to this example:

// Note: It's an example and not working code - the actual function is much larger
function split_db()
{
    $results = "
        SELECT *
        FROM big_table
    ";

    foreach ( $results as $result )
    {
        // Here I split the big_tables contents and ...
        $some_val = $result->SomeVal;
        // ...
        $another_val = $result->AnotherVal;

        // ... here I insert the contents in the different tables
        $sql = "
            INSERT
            INTO first_small_table
            // ...
            VALUES
            // ...
        ";
    }
}

Problem: The query inserts 255 rows, no matter if I’m in the local environment or on the test server.

Question: Why? What am I doing wrong or am I missing something? And how would I avoid this?

Info about MySQL-Client-Version:

  • Dev-Server: 5.0.32,
  • Local Dev-Env.: 5.1.41

I’m no MySQL-Hero, so any help and explanation is appreciated, as Google brought nothing meaningful (to me) up. 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-24T15:39:01+00:00Added an answer on May 24, 2026 at 3:39 pm

    I bet you have your primary key of unsigned tinyint type, that has limit of 255 for the maximum value.

    So change it to just int

    ALTER TABLE first_small_table MODIFY id INT;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an MFC application, that got pretty messy over years and over
I've got a pretty minor problem that I think can be resolved by re-thinking
I've got an app that's working pretty flawlessly in Chrome and FF, however, when
I've got a flex component which works pretty well but unfortunately turns into a
So this one is a doozie; I've got a pretty large OpenGL solution, written
I've got a pretty large DB hooked up to my Entity Framework. I've got
I'm using CodeIgniter and one of my views got pretty large so I moved
I've got a DataGridView with a ComboBox in it that might contain some pretty
I have been developing a library that is getting pretty large, and now I
I've got a fairly large MFC application that has just been migrated from VS6.0

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.