while(odbc_fetch_row($viewTablo)){
echo "<td>".odbc_result($viewTablo,$inta)."</td>";
echo "</tr>";
}
This code works and returns values I expected. But when I use odbc_fetch_row
multiple times, just the first one works. What is the reason and how do I prevent this?
It will only fetch as many rows as are present in your query results. Once you run out of rows, it will return false
as per the documentation. It does not return the result set's internal pointer to the beginning of the results.
If you want to loop over the data multiple times you can put it all into a PHP array when you first extract it from the database, and then use the array later on in the script when you need to access it.