$columns = M_NumColumns($conn, $identifier); /* Print all the headers separated by |'s */ for ($i = 0; $i < $columns; $i++) { if ($i != 0) { echo "|"; } echo M_GetHeader($conn, $identifier, $i); } echo "\r\n"; /* Print one row per line, each cell separated by |'s */ for ($j = 0; $j < $rows; $j++) { for ($i = 0; $i < $columns; $i++) { if ($i != 0) { echo "|"; } echo M_GetCellByNum($conn, $identifier, $i, $j); } echo "\r\n"; } /* * Use M_GetCell instead of M_GetCellByNum if you need a * specific column, as the results will allow for position- * independent searching of the results. The ordering of * returned headers may be different between Monetra versions, * so that is _highly_ recommended */ /* Optionally free transaction, though M_DestroyConn() will * do this for us */ M_DeleteTrans($conn, $identifier); /* Clean up and close */ M_DestroyConn($conn); M_DestroyEngine();
function MCVE_GetCellByNum(&$conn, $id, $col, $row) { return M_GetCellByNum($conn, $id, $col, $row); }