On Sunday 01 December 2002 18:33, Vicky wrote:
> Hiya ^_^
>
> I have a guestbook I coded myself using PHP. In the corner it keeps record
> of the entry number, but when I delete and entry the entries posted after
> it don't go back to catch up. So the entry numbers skip from 22 to 24, for
> example.

You're probably using some kind of 'autoincrement' field for your entry 
number. 

> Is there anyway to stop this happening, so if i delete an entry the next
> one will follow on instead of being the number it would have been if i
> hadn't deleted the entry?

The short answer is if you want that kind of behaviour then you shouldn't be 
using an autoincrement field.

The quick solution, if you intend to continue the autoincrement field, is to 
number the entries manually when you're displaying them: Something along the 
lines of:

  $count = 0;
  while ($row(mysql_fetch_array($result_id))) {
    $count++;
    echo "Entry $count";
    ...
    ...
  }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If bankers can count, how come they have eight windows and only four tellers?
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to