I have no idea where that code came from, nor the ideas behind it.
The way the Zen Cart database query infrastructure works is this:
Code:
$sql = "select * from " . TABLE_TABLENAME . " WHERE field='value'";
$result = $db->Execute($sql);
while (!$result->EOF) {
$my_variable = $result->fields['fieldname'];
// and/or do something with that $my_variable value
$result->MoveNext(); // to tell it to advance to the next record
} // this loops back to the "while" loop, repeatedly, until the EOF is triggered when all the results have been returned.
In v155 the code is even simpler, but you specified v154 so I gave you the old syntax.
Bookmarks