Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: First empty record in SQL  (Read 3411 times)

0 Members and 1 Guest are viewing this topic.

yanng1

    Topic Starter


    Beginner

    First empty record in SQL
    « on: February 05, 2008, 04:59:16 PM »
    Hi thanks for taking a moment, as always ;)

    I would like to insert a record in the first unused space in a MySQL table.  I am using PHP.
    I really don't want to loop and look, it seems like overkill.  I think MySQL must have command to return the value of the first vacant record to a PHP script.
    does anyone know of a command or operation similar to this? 

    Thanks in advance,
    G.R.

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: First empty record in SQL
    « Reply #1 on: February 08, 2008, 01:49:13 AM »
    What do you mean by "vacant record"?  Do you mean a record with several fields, all set to NULL?  What fields are there in your database?
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    Deerpark



      Egghead
    • Thanked: 1
      Re: First empty record in SQL
      « Reply #2 on: February 08, 2008, 11:04:52 AM »
      A basic SQL insert statement should place your data in the first available row.
      But like (I think) Rob Pomeroy is hinting at this wont work if you have rows filled with null values. If you do, you should really do something about it.
      Any sufficiently advanced technology is indistinguishable from magic.
      Arthur C. Clarke (1917 - 2008)