Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

int row...What is this parameter for?

Status
Not open for further replies.

Michael42

Programmer
Joined
Oct 8, 2001
Messages
1,454
Location
US
Hello,

In the mySQL function mysql_result(resource result, int row [, mixed field]) what exactly is the int row parameter for?

I use 0 (zero) and everything works but would like to know why?

Thanks,

Michael42
 
So you have a result set... it looks something like this

city | team
----------------
chicago cubs
ny yankees
boston red sox


If you ask for the city of row 0, you'll get chicago, of row 1 you'll get ny, and so on. It's for results that return multiple rows. If your result only returns one row, then you'll always use 0.

(If you're using multiple rows the manual suggests using a fetch to get the whole row at a time rather than using the random access)

 
skiflyer,

Thanks - your explanation is very useful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top