| Subject |
Re: Accessing a database that is stored in dropbox |
| From |
Michael <michael@abstractservices.com.au> |
| Date |
Tue, 31 Aug 2021 03:34:07 -0400 |
| Newsgroups |
dbase.getting-started |
Matt Milner Wrote:
> I am using dBase 2019 to create a program to automate the manufacture of HVAC components for large buildings. As part of the security for this program, I have placed a database on dropbox with a link similar to this:
> https://www.dropbox.com/s/???????????????/ExpirationDates.DBF?dl=0
> When the customer's program approaches their expiration date, I would like to access this database to see whether they have paid us to extend their expiration date. So this is not a web based program . . . just web data that needs to be accessed. How should I proceed?
Dear Matt,
I achieved exactly that by setting up a web database and OleAutoClient to run a hhtp url and an online php scripts to read and write functions on the tables.
I send a url www.yourwebsite.com?checkexp.phpClientid=10203
It then runs the checkexp.php which will look something like
<?php
$ClientId = $_GET['ClientId'];
$_SESSION["SkipConnectMySQL"] = "";
$host = ":3306";
$db = "database name";
$user = "databaseuser";
$passwd = "apassword";
$link = @mysqli_connect("localhost",$user, $password,$db);
$conn = $link;
if ($_SESSION["SkipConnectMySQL"] == "") {
if(!$link) {
print "Could not connect to the MySQL Host<br><br>Message(s):<br>" . mysqli_error() . "<br>";
exit ;
}
/* if(!@mysqli_select_db($db)) {
print "Could not connect to the MySQL Database<br><br>Message(s):<br>" . mysql_error() . "<br>";
exit ;
}
*/
}
$asql = "Select * FROM tablename WHERE Client_id='$ClientId' ";
$result = mysqli_query($link, $asql);
if (!$result) {
print "error";
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
print_r($row);
}
}
?>
Hope this makes sense to you.
Any questions feel free to ask.
Michael.
|
|