[PHP] Re: Guestbook

2002-12-01 Thread Thomas Seifert
Hi,

you give less information.
How do you compute the entry number and how do you save the entries and so on.
Normally you will have to live with the gaps but sure, you can touch every entry
and change its number ;-).


Thomas

On Sun, 1 Dec 2002 10:33:45 - [EMAIL PROTECTED] (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.
 
 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?
 
 Thanks ^_^
 

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




[PHP] Re: Guestbook

2002-12-01 Thread sfasf saff
in mysql the autoincrement field will not go back to
fill gaps...

and this is for a good reason ...

suppose you had an entry (bogus1) in your guest book
with entry number 23 and you deleted it...

now a new entry comes and it is given the entry number
23 ... well this ambigus : did u delete the original
one or modified it ? also people pointing to that
particular entry in their sites will be confused by
the change... where as in the real life we usuallay
offer a record does not exist type of message ...

got it ?!
--- Thomas Seifert [EMAIL PROTECTED] wrote:
 Hi,
 
 you give less information.
 How do you compute the entry number and how do you
 save the entries and so on.
 Normally you will have to live with the gaps but
 sure, you can touch every entry
 and change its number ;-).
 
 
 Thomas
 
 On Sun, 1 Dec 2002 10:33:45 -
 [EMAIL PROTECTED] (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.
  
  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?
  
  Thanks ^_^
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
+--+
|Wana Know what ISLAM is all about ? |
+--+

visit :   http://www.sultan.org/#int

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Re: Guestbook question

2002-02-22 Thread Matthew J Gray

Take a look at mysql_data_seek()

Matt

James Taylor wrote:
 
 I have a really simple guestbook that allows someone to post to the book,
 then it displays all the entries.  Well, there are too many entries now for
 just one page and it looks kinda wacky, so I wanted to do something where it
 only displays 10 entries per page, then there are links for pages say 11-20,
 21-30, etc.   I have no idea how to do this - I only know how to limit the
 number of entries per page.  So, the script that displays all the entries
 looks something like this:
 
 $counter = 0;
 $result = mysql_query(select name, post from guestbook order by id desc,
 $db);
 
 while (($myrow = mysql_fetch_row($result))  ($counter  10)) {
echo TRTD$myrow[0]/TD/TR\n;
echo TRTD$myrow[1]/TD/TR\n;
++$counter;
 }
 
 Well, that shows only the latest 10 alright, but what if I wanted to show
 entries 11-20?  I figure I could get the number of posts through
 mysql_num_rows, I just can't piece it all together.  Any suggestions would be
 really helpful.

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