Thread: INSERT??

    #1
  1. No Profile Picture
    stefanbecker
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi,

    when I insert new data into a table, where is it gonna be, at the end or the beginning?
    If it is the end, how do i get it to put the new data at the beginning??
  2. #2
  3. No Profile Picture
    donarb
    Guest
    Devshed Newbie (0 - 499 posts)
    The whole concept of relational databases is that the system is responsible for storing your data, you don't have to worry where or how it is stored.

    However, when returning data from a query, you can sort data on one of the columns using "ORDER BY". This could give you the first or last records entered if the ORDER BY field is a timestamp. Or if you use an auto increment integer key in your table, you could get the last record entered by using this select statement:

    SELECT * FROM table WHERE id = LAST_INSERT_ID();

Similar Threads

  1. Zip code validation
    By krwyth in forum MySQL Help
    Replies: 2
    Last Post: January 5th, 2004, 01:29 PM
  2. error - parent key
    By mbonfyre in forum Oracle Development
    Replies: 1
    Last Post: November 29th, 2003, 12:44 PM
  3. Accesing dates in Mysql thru PHP
    By carlmty in forum PHP Development
    Replies: 1
    Last Post: January 7th, 2003, 03:52 AM
  4. Uknow Known MYSQLERROR
    By andyw in forum MySQL Help
    Replies: 7
    Last Post: January 23rd, 2001, 09:34 AM
  5. Help! Database design
    By gerrychu in forum MySQL Help
    Replies: 4
    Last Post: December 13th, 2000, 04:07 PM

IMN logo majestic logo threadwatch logo seochat tools logo