Originally posted by agoodeill
I need help, and a sample, or someone to show me how... but I am on a time crunch. I am new to this, but I was asked to get pull a access DB into a browser for one person, and to pull only certain fields for another. Can anyone help me with this code?
Please help.
Anthony
I am assuming that what you are asking for is the ability to display database field values of an access database in a web page.
If so, use php as follows:
Step1: Import the access database into MySQL (because I like MySQL 😛)
Step 2: Create a PHP page and pull out data from database 1 table at a time:
<?
// create database connection
$conn = mysql_pconnect('localhost', 'user', 'passwd');
if (!$conn)
echo "Could not connect to mysql";
if (!mysql_select_db("database"))
echo "Could not connect to database";
// select all fields from table within database
$query = "select * from tblTableName";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$row_num = mysql_num_rows($result); //get number of rows in database
//display all values
for ($x=0; $x<$row_num; $x++){
echo $row['FieldName1'];
echo "<br>".$row['FieldName2'];
//etc etc etc....
}
?>
Just specify which fields you want to display and display them! If you need to limit the fields that you want to display and security is not an issue, then just create a new PHP page that only displays a limited number of fields.
Hope this helps.
-vivianp
P.S. The PHP manual has lots and lots of information on this.