Re: Mysql Rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thank you. the table does have and id feild that auto increments, however if
you delete a user there will be a gap between the users between which would
not be what is not acurate enough. thank you for you help. simple fix. i
should have caught it.
----- Original Message ----- 
From: "Anthony Ettinger" <aettinger@xxxxxxxxxxxxxx>
To: "benifactor" <snorris17@xxxxxxx>
Cc: "php" <php-general@xxxxxxxxxxxxx>
Sent: Friday, March 03, 2006 3:52 PM
Subject: Re:  Mysql Rows


define $1 = 0 outside your loop.

i'm curious why you are relying on row-order in the database?
Typically you'd have a PRIMARY KEY auto_increment for something like
this.


On 3/3/06, benifactor <snorris17@xxxxxxx> wrote:
> i need to find a way to find out what number of a row is in a database...
>
> for example:
>
> //this is the database
> Username: Chuck Password: adsasa
> Username: jimmy Password: adsf
> Username: stewart Password: dfds
>
> the information i need is what row jimmy resides on..
>
> this is what i tried:
>
> function i_gun ($user) {
> global $username;
> $gun = mysql_query("select * from users");
> while ($d = mysql_fetch_array($gun)) {
> while($d[username] != $user) {
> $i = $i + 1;
> }
> }
> }
>
> but it always returns 1. can sombody tell me what i am doing wrong or
point me in the right direction in the manual? plase and thank you
>


--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux