I've an access database, and among the tables is known as Products, which consists of 9 rows. I wish to echo all the rows, however when I personally use this code, it'll echo only 4 rows. Where's my fault ?

$conn = odbc_connect('MoeinODBCTest1', '', '');
$sql = "select * from Products";
$rs = odbc_exec($conn, $sql);

while(odbc_fetch_row($rs))
{
   $arr = odbc_fetch_array($rs);
   print_r($arr);
   echo '<br>';
}

Both odbc_fetch_array and odbc_fetch_row are tugging rows from the results.

Try rather:

$conn = odbc_connect('MoeinODBCTest1', '', '');
$sql = "select * from Products";
$rs = odbc_exec($conn, $sql);

while($arr = odbc_fetch_array($rs)) {
    print_r($arr);
   echo '
';
}

You're fetching rows both when calling odbc_fetch_row and odbc_fetch_array, so every second row will get thrown away.

Since odbc_fetch_array returns FALSE when you will find forget about rows, technology-not only to fetch the following row and appearance if you will find anymore rows, simultaneously:

while ($arr = odbc_fetch_array($rs)) {
    print_r($arr);
    echo "\n";
}