SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why does mysql keep inserting data in random places and how can I fix this?

    I am using mysql 5.0.51a with php 5.2.5

    I am using the insert command to enter data.

    It keeps inserting data in random locations in the table, which is messing up my web app.

    It did use an id column at one time.

    I've tried flushing the table, and remaking the table with phpmyadmin's sql dump.

    How can I fix this? I just want mysql to insert data at the end of the table, like it should.

    <snip>
    Last edited by Dan Grossman; Jun 24, 2010 at 19:38. Reason: Fake signature removed

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There is no intrinsic ordering to the data. None of the default storage engines guarantee data will be stored in insertion order. You have to order by some column if you want it sorted.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,322
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by satokenta View Post
    It keeps inserting data in random locations in the table, which is messing up my web app.
    fix your web app, because the database is behaving exactly as it should

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •