request

From: Date: Thu, 17 Apr 2003 14:10:19 +0000
Subject: request
Groups: php.general 
Request: Send a blank email to php-general+get-144279@lists.php.net to get a copy of this message
in row 0 "mike" in row 1 "paul" in row 2 "lena" <?php mysql_connect('host','user','passwd'); mysql_select_db('db'); $name = "e"; $query = "select * from guests where name like '%$name%'"; $row=0; $result = mysql_query($query); while($res = mysql_fetch_array($result)){ echo "The result is in row: $row"; $row++; } ?> when I do like this it echoes mike is in row 0 lena is in row 1 what should i do that it echoes the exact row number mike is in row 0 lena is in row 2 when i use an ID number -1 it works but if I delete some rows the ID numbers 123456 leave like 146 and then it echos wrong row number -- Marius mariusrk@delfi.lt

« previous php.general (#144279) next »