westminster Posted May 3, 2006 Share Posted May 3, 2006 hi anyone, im new to php however i am creating an application that uses php to connect to a ms access database via ODBC i have configured it together according to the instruction i read. i created a file called 'odbc.php' which contains the details. however i read that to link individual webpages to insert/update data in the database i have to write a php code for it in the page i want connected. Can anyone pls tell me what the code i need to put in is and where in the document page should i place the code? Also could you have a look at my odbc.php code to tell me if it's written correctly?$odbc = odbc_connect ('project', '', '') or die('Could Not Connect to ODBC Database!'); ?> <? if(!function_exists('')) { function odbc_fetch_array($result, $rownumber=-1) { if (PHP_VERSION > "4.1") { if ($rownumber < 0) { odbc_fetch_into($result, $rs); } else { odbc_fetch_into($result, $rs, $rownumber); } } else { odbc_fetch_into($result, $rownumber, $rs); } $rs_assoc = Array(); foreach ($rs as $key => $value) { $rs_assoc[odbc_field_name($result, $key+1)] = $value; } return $rs_assoc; } } ?> Pls help. i'll appreciate even the smallest help. Quote Link to comment https://forums.phpfreaks.com/topic/8930-help-php-v-odbc/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.