function odbc_fetch_array_custom($id_res)
{
// Clear our return variable
unset($ar);
// Get the number of fields in the returned result
$colnum = odbc_num_fields($id_res);
// Fill an array with the column headers
// We do this here to save API calls.
for($i=1; $i<=$colnum;$i++)$field_name[$i]=odbc_field_name($id_res,$i);
// If we have a result
if (odbc_fetch_row($id_res))
{
// Fill our return array with the column data
for ($i = 1; $i <= $colnum; $i++)
$ar[$field_name[$i]] =
odbc_result($id_res, $field_name[$i]);
return $ar;
}
else
{
return false;
}
}
?>
örnek
<?php
$db = "monkeys";
// odbc_connect_custom was in part 1
$connection_id = odbc_connect_custom($db);
$query = "SELECT name,amount FROM monkey_types";
$result_id = odbc_exec($connection_id,$query);
while($result=odbc_fetch_array_new($result_id))
{
// Do whatever we want with the row
print($row["name"]."<br>");
print($row["butt_color"]."<br>");
}
?>
kaynak: ordan burdan
Tags: access, key, nasıl, nedir, php, scripti, Scriptler, vePhp - Odbc Ile Access Veritabanından Bilgi çekmek (scripti, nasıl, nedir?) konusu
Benzer yazılar:
- Benzer yazı yok