PHP 8.5.0 Alpha 2 available for testing

Voting

: seven plus zero?
(Example: nine)

The Note You're Voting On

xhat at NOSPAM dot hotmail dot com
21 years ago
This is a quick and dirty way to accomplish the same thing:

<?
while(odbc_fetch_row($result)) {
$var1 = odbc_result($result, "NAMEOFFIELD1");
$var2 = odbc_result($result, "NAMEOFFIELD2");
..... //as many vars as you have fields with data to capture

$array_of_results[] = compact('var1', 'var2','var3', etc, etc)
}
?>

Just turn each returned row's data into variables then use the compact(). Turns each variable name into a key and the vars value into the array value. Makes a wonderful 2d array that you can walk easily and still use key values to get at data.

<< Back to user notes page

To Top