here is an access one

<HTML>
 <HEAD>
 </HEAD>

 <BODY>

   <?php

// Program to test connecting to a Microsoft Access ODBC Data Source
$connection = odbc_connect("postcard", "", "");
print "Connected to datasource<BR><BR>";
//$sql="SELECT * FROM postcard";
$sql="insert into postcard (sendername, senderemail, receipt, receiptemail)
values ('bka', '[EMAIL PROTECTED]', 'bastien', '[EMAIL PROTECTED]')";


if ($result = odbc_exec($connection, $sql))
print "Command executed successfully<BR><BR>";
else
print "Error while executing command<BR><BR>";
/*
// Print results
while(odbc_fetch_row($result))
print odbc_result($result, 1) . " " . odbc_result($result, 2) . " " . odbc_result($result, 3) . " " . odbc_result($result, 4) . " " . odbc_result($result, 5) . "<BR>";
*/
odbc_close($connection);
print "<BR>Connection closed.";


   ?>

 </BODY>
</HTML>


bastien


From: "tom mccord" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Need simple example for making an odbc connection
Date: Mon, 25 Oct 2004 15:07:48 -0500

I am very new to php and I need a simple example for connecting and
retrieving from an odbc connection.

The code I am maintaining currently accesses MySql using the built in
functions for it, but I need to access DB2 and Access databases.

Thanks
- Tom

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to