/*
Written by Brad Simonin.
This PHP page writes information from an Access 2000 database to an HTML table using the
PHP ODBC functions.
*/
?>
Brad Simonin's GuestBook
$SqlString = "SELECT GuestBook_Id, Name, Company_Occupation, City,
State, E_Mail, Web_Page FROM Brads_GuestBook ORDER BY Time_Stamp Desc";
?>
Brad Simonin's GuestBook
| Name |
Occupation |
City |
State |
E-Mail |
Web Page |
View Comments |
$db_connect = odbc_connect("Brad2000","","");
$execute_query = odbc_exec($db_connect,$SqlString);
$KeepFetching = True;
do
{
$getRow;
$getRow=odbc_Fetch_Row($execute_query);
if($getRow)
{
$Id = odbc_result($execute_query,"GuestBook_Id");
$Name = odbc_result($execute_query,"Name");
$Occupation = odbc_result($execute_query,"Company_Occupation");
$City = odbc_result($execute_query,"City");
$State = odbc_result($execute_query,"State");
$E_Mail = odbc_result($execute_query,"E_Mail");
$WebPage = odbc_result($execute_query,"Web_Page");
$ChkWebPage = strpos($WebPage,"#",0);
if (gettype($ChkWebPage) == "integer")
{
$ThePos1 = strpos($WebPage,"#",0);
$ThePos2 = strpos($WebPage,"#",$ThePos1++);
$LenPos = $ThePos2 - $ThePos1;
$WebPage = substr($WebPage,$ThePos1++,$LenPos);
}
?>
echo $Name ?>
|
echo $Occupation ?>
|
echo $City ?>
|
echo $State ?>
|
echo $E_Mail ?>
|
echo $WebPage ?>
|
|
}
else
{
$KeepFetching = False;
}
}
while ($KeepFetching);
?>