Date: 07/29/02
- Next message: Benjamin Pflugmann: "[PHP-DB] Re: time field query problems."
- Previous message: Philip Hallstrom: "[PHP-DB] Re: ORDER BY from 2 tables"
- In reply to: Georgie Casey: "[PHP-DB] Auto Increment Problems...."
- Next in thread: Raquel Rice: "Re: [PHP-DB] Auto Increment Problems...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Op dinsdag 30 juli 2002 05:44, schreef Georgie Casey:
> So I've 2 questions
INSERT TABLE id values('');
leave it empty
> 1) Can the next auto_increment value be 'set' by a SQL query????
> 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the ID
> column??
I don't think so. You can mark the row, when you delete it.
Make the field mark (or you a field you already have) b.e small int (1)
In stead of deleting, you insert empty values and set mark to 1
If you insert a row, you need a extra query:
SELECT id where mark=1 SORT BY id ASC
If no row found insert with id (see above) else use the id found;
UPDATE TABLE SET i mark='0'............. WHERE id='$first_ID_with_mark_is_1'
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Benjamin Pflugmann: "[PHP-DB] Re: time field query problems."
- Previous message: Philip Hallstrom: "[PHP-DB] Re: ORDER BY from 2 tables"
- In reply to: Georgie Casey: "[PHP-DB] Auto Increment Problems...."
- Next in thread: Raquel Rice: "Re: [PHP-DB] Auto Increment Problems...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

