Article View: ba.php
Article #92How do u find the highest auto_generated ID number.
From: Adrian Game
Date: Mon, 18 Sep 2000 00:00
Date: Mon, 18 Sep 2000 00:00
25 lines
1573 bytes
1573 bytes
I have a log in system that uses the auto_generated ID number + a password that is also stored in the same row. The code works fine for a proper ID number and password loging the user in but I want to stop errors that are caused when and ID number is used, that is not present in the database for when this hapens i get the following message Warning: Unable to jump to row 0 on MySQL result index 2 in c:\inetpub\wwwroot\linksdev\login.php3 on line 17 This could be a potental secuirty risk so I need to stop this happening. I had thought of counting the number of rows in the database and stoping ID that are larger than the number of rows but this would cause problems if users delete the information removing a row. This would mean that altough there might be 22 rows the last ID still might be 23 as an earlyer entry has been removed. If you have any ideas or would like a better explination please let me know! Adrian http://www.devilsbeach.co.uk
Technical Details
Message-ID:
<8q51i8$nut$1@neptunium.btinternet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ce1c,d4a6c26383bfa6a2,start X-Google-Attributes: gid10ce1c,public X-Google-Thread: 108904,d4a6c26383bfa6a2,start X-Google-Attributes: gid108904,public From: "Adrian Game" <adgs_98@btinternet.com> Subject: How do u find the highest auto_generated ID number. Date: 2000/09/18 Message-ID: <8q51i8$nut$1@neptunium.btinternet.com> X-Deja-AN: 671170668 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Organization: BT Internet X-MSMail-Priority: Normal Newsgroups: ba.php,mailing.www.php-user