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