I'm developing an appliocation that pulls data from two databases: one is MySQL, the other is Sage Line 100 (via ODBC).
I'm familiar with extracting data and displaying the resulting recordset, using either:
while ($row_rsList = mysql_fetch_array($rsData)) //for MySQL data
or
while ($row_rsList = odbc_fetch_array($rsData)) //for ODBCL data
Because the Sage ODBC driver is very flakey, I've created a couple of duplicate tables in MySQL, into which I import the ODBC data from time to time.
The idea is that I can check to see if the ODBC link is available, and if not, use the backup data from MySQL. To do this, I simply check whether odbc_connect returns an error, and if so, use MySQL instead.
Basically, I end up with either:
$row_rsData = odbc_fetch_array($rsData);
or
$row_rsData = mysql_fetch_array($rsData);
I'd like to be able to loop through the data in $row_rsData, without using the regular method, because I don't want to be specific about where the data has originated.
Hope this is clear enough. Any help is much appreciated.