none wrote:
Howdy all,
I'm wondering if someone could give some direction on a problem I have
or share their experiences.
I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?
Thanks for any help
which web server Apache or IIS. (I am assuming Wxx as you are using Access)
Using google, you can find MANY examples of using ODBC (db is somewhat irrelevant).
here is an example right out of the docs:
$con = odbc_connect('MSAccessDriver','','');
if ($con)
{
echo "odbc connected<br>";
$sql = "select * from Results";
//this function will execute the sql satametn in
//correspondance to the table in the db
$exc = odbc_exec($con,$sql);
}
else
echo "odbc not connected<br>";
if($exc)
{
echo "selection completed<br>";
while($row = odbc_fetch_row($exc) )
echo $row->id."<br>";
}
else
echo "selection failed<br>";
?>
and another example
$Fields = odbc_num_fields($cur);
print "<table border='1' width='100%'><tr>";
// Build Column Headers
for ($i=1; $i <= $Fields; $i++){
printf("<th bgcolor='silver'>%s</th>", odbc_field_name( $cur,$i));
}
// Table Body
$Outer=0;
while( odbc_fetch_row( $cur )){
$Outer++;
print "<tr>";
for($i=1; $i <= $Fields; $i++){
printf("<td>%s</td>", odbc_result( $cur, $i ));
}
print "</tr>";
}
print "</table>";
print "<b> Your request returned $Outer rows!</b>";
--
Michael Austin.
Consultant - Available.
Donations welcomed.
Http://www.firstdbasource.com/donations.html
:)