#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    I want to know the row number in a mysql
    database,
    i found mysql_num_rows($result);
    this is the total number of rows,
    but now i want to know from the number of the selected row.
    i used to work with clipper5.0 ,
    there it was recno(), but what's the function
    in mysql ??

    thanks for reply,

    Jan.
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    There are no record numbers when using a relational db unless you put them there yourself as one of the fields. mysql has an auto_increment keyword that can be used when creating a table that will, you guessed it, auto_increment an integer data type and assign the next integer to a record when it is inserted.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    okay, i understand that, but can somebody
    tell me how to find out the row number
    of an array ??
    i get the result, but after it i want
    to know on which row i am while doing
    a do..while.. loop.

    thanks !

    Jan.
  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    If that's important you should probably use a for loop.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    even if i do a for loop,
    i still want to know the array number
    which is being handles

    thanks !
    jan.
  10. #6
  11. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    ????

    You would use the index of the for loop to index your array.

Similar Threads

  1. Replies: 2
    Last Post: September 22nd, 2003, 09:27 PM
  2. changing a row in a mysql database
    By pwned in forum PHP Development
    Replies: 3
    Last Post: August 29th, 2003, 09:17 AM
  3. mysql database help!
    By TweetyPie in forum MySQL Help
    Replies: 2
    Last Post: August 1st, 2003, 06:20 AM
  4. Handling null row from mysql database.
    By gossiplist in forum PHP Development
    Replies: 2
    Last Post: May 13th, 2003, 10:31 PM
  5. Getting Access to use MySQL
    By -=-steve-=- in forum MySQL Help
    Replies: 1
    Last Post: November 11th, 2001, 11:01 AM

IMN logo majestic logo threadwatch logo seochat tools logo