www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to correct set MYSQL query to add row?

  1. #1
    Join Date
    Sep 2005
    Posts
    1,625

    Question How to correct set MYSQL query to add row?

    I like to set added MYSQL query to add row after last row.
    How to do it as I have first field UUID and last two dattime in UNIX FORMAT.

    PHP Code:
    INSERT INTO mytable
    (idmynamedescriptioncreatmodifyVALUES('UUID''' ,'' ,'' ,''

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    I'm not completely sure I understand your problem, are you asking how to set up an autoincrement primary key?
    Code:
    alter table `table name` modify `id field` int primary key auto_increment;
    Would work to modify an existing field.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  3. #3
    Join Date
    Sep 2005
    Posts
    1,625
    1. I like to set added MYSQL query to add row after last row. Not EDIT...
    2. first field UUID and last two dattime in UNIX FORMAT.

    So, value should be for FIRST field UUID value
    Description like URL:
    http://www.famkruithof.net/guid-uuid-info.html

    Structure of table: id, myname, description, creat, modify
    Last edited by toplisek; 03-24-2011 at 08:58 AM.

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Hi,

    your first SQL Statement will insert/add a new row to your database table. Technically there is no row order to a Table only which page it's stored in.

    If you table already has rows then a new row will be added to a page, either added to an existing page (if space) or added to a new sequential page.

    This is the reason why we normally use a numbered column or record the date the record was create so we can query and retrieve the data in a particular order.

    Scragar has given you an example on how to use a numbered column to allow for the quering of the data so you can clearly retrieve the last record inserted.


    regards


    Ribs
    ----------------------------------

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles