If I search a database and it returns multiple results, what should I use to grab each result so that I can display each one in the browser. Below is the search and I thought I would use the num_rows variable to how a message if no results are found.
[code=php]
$result = mysql_query(“SELECT isbn, bookTitle, bookAuthor, thumbnail FROM BooksForSell WHERE ISBN='”.$booksearch.”‘”) or die(mysql_error());
$num_rows = mysql_num_rows($result);
While the below is not quite formatted the way it will end up looking, I basically want to have a for loop go through the results and show each one in HTML similar to below. I assume that maybe an array would be best for this but I am not sure what the function is to get the results into an array.
[code=php]
echo ‘
Title: ‘ .$title. ‘
Author: ‘ . $author . ‘
ISBN: ‘ . $isbn . ‘
Price: ‘ .$price’
Condition: ‘. $condition . ‘
<img src=”.$thumbnail.”>’;