kleenhead Posted March 2, 2010 Share Posted March 2, 2010 it should echo the first column of the first row of an access database. but nothing happens. <? $db = "box_of_items.mdb"; $dbdir = "D:/box/b523945/xmu/"; $query = "SELECT * FROM tblItems"; function dbquery($query) { $arr = array(); $connection_id = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$dbdir.$db"); $result_id = odbc_exec($connection_id,$query); $x = 1; while (odbc_fetch_row($result_id)) { for ($y = 1; $y <= odbc_num_fields($result_id); $y++) $arr[$x][$y] = odbc_result($result_id,$y); $x++; } if ($x > 1) return $arr; } $arr = dbquery($query); echo $arr[1][1]; odbc_close($connection_id); ?> Link to comment https://forums.phpfreaks.com/topic/193913-why-wouldnt-this-work/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.