$result = dbx_query ($link, 'SELECT id, parentid, description FROM table'); echo "table \n"; foreach ($result - data as $row) {echo" tr \n"; foreach ($row as $field) {echo "td $field / td";} echo "/ tr \n";} echo" / table \n";
?php $link = dbx_connect( "odbc", "", "base de données", "utilisateur", "mot de passe") or die ("Impossible de se connecter"); $result = dbx_query($link, "SELECT id, parentid, description FROM tbl"); if ($result==0) echo "La requête a échoué\n br "; elseif ($result==1) {echo "La requête a réussie\n br";} else {$rows=$result - rows; $cols=$result - cols; echo "p table dimension: {$result - rows} x {$result - cols} br table border=1 \n"; echo" tr "; for ($col=0; $col $cols; ++$col) {echo" td -{$result - info["name"][$col]} - br -{$result - info["type"][$col]} - / td ";} echo" / tr \n"; for ($row=0; $row $rows; ++$row) {echo "tr"; for ($col=0; $col $cols; ++$col) {echo "td -{$result - data[$row][$col]} - / td";} echo "/ tr \n";} echo" / table p \n"; echo "table dimension: {$result - rows} x id, parentid, description br table border=1 \n"; for ($row=0; $row $rows; ++$row) {echo "tr"; echo "td -{$result - data[$row]["id"]} - / td"; echo "td -{$result - data[$row]["parentid"]} - / td"; echo "td -{$result - data[$row]["description"]} - / td"; echo "/ tr \n";} echo" / table p \n";} dbx_close($link);?