I'm having trouble getting my program to select a specific row from a MySQL result set. I know how to fetch the first row from a result set and I know how to print out the entire result set but that's about all I can do with it.
My situation is this: the program runs a query and grabs all the rows from a table (skill_info) where Joe has a listed skill. The result set has 3 rows and one of those rows is Joe's skill in carpentry. I want to grab that row and put it into $row[].
I thought of trying this:
mysql_data_seek ($result, 0);
while ($row = mysql_fetch_array($result)){
extract($row);
if ($row['skillnum'] == "54"){
exit;
}
}
but it exits the whole script/program when I only want to exit the loop.
Can anyone help? There must be a way to make mysql_fetch_array fetch only the row I want.