is it possible to create a system that is connected a website with the same database - php

Good day. I have a thesis project. it is composed of a webpage created on php and a system using vb.net 2008.
As of now , they are both connected to the same database.
I am wondering if it is possible that if i packaged the system and live the website, will still be connected with one database? Thank you in advance.

If I understand you right (and the question could be better worded), you're asking what happens if you deploy the website on a different server than the one you used to develop it. The short answer is that, unless the machine hosting the database is accessible to the web server host machine, that you would also have to redeploy the database.
In other words, wherever you move the PHP-based website and VB.NET system, they would need to be able to access the machine hosting the database server. Otherwise, I see no issue with them both accessing the same database.

Related

How to make PHP web application work online and offline?

I am new into web development. I have PHP web application which I created using some Rapid Development Tool. For now I can run it on the server with online database and as well i can run it on my local machine with local database (offline, using XAMPP).
The question is: How to make web PHP application that will be:
stored locally
be able to easily update somehow on different devices
will work with online database when internet is here. Once internet is not here, database will be switched to local one.
databases will be synchronized as well
Is there any software that can handle all of this? Or should I do it manually? Since I am new here, I have completely no ideas on how to realize that.

How to access Data from another Server not in the same Network

Hello guys.
In our actual project we got a Microsoft Server accessed via remotehost. On this server we installed xampp ,Microsoft SQL Server and our previously in ObjectPascal developed program.
Then we have a Microsoft SQL Server at our Customers. Then we have our Application, programmed in ObjectPascal, installed, that works with the SQL-Server and is programmed by our company.
Our Web-solution is programmed that it can work with the database like our old programm. Furthermore we would like to use the old program for working locally and our web solution for working remotely. Furthermore the databases on the web-server and at our customer are identical.
Now we have the problem how we can access the data at our Customers SQL Server, without the need of complex configuration at our customers network.
Our thoughts were:
A Web Server at our customer and access the data per AJAX.
Customers Server permanently asking the web-server if it needs data
Doing something similar like 'push up notification' sending from the web-server to our customer.
Maybe synchronising to and from the server?
We are able to get the public IP-Adress from our customer and are able to update it if it change, so that is no problem. The only problem we have is, how we can access the data from our customer. Maybe our solutions go to a completely wrong direction, that's why i am asking you guys.
If you could give me some hints, tips and tricks, maybe a link or a technology name would help me and we would be really gratefull for that.
I thank you for your time reading this!

What kind of remote server service was I using?

I’m part of a very small company that uses a database hosted on a server (104.131.##.###). However, the server no longer responds and the person who set up and owns the server space has already left the company. This past employee seems disgruntled so they won’t help. It’s complicated, but we decided to open a new server. The only issue is, I don’t know what we were using.
What I do know is I would access and change the database at http://104.131.##.###/phpmyadmin/ (image of login below)
I also had php files stored on the server using Filezilla (in a “var” folder, if that helps) which were accessed via path: http://104.131.96.###/path/to/file.php
I’ve set up a version of the same server using xampp on my own computer, but I can’t keep my computer running constantly.
So my question is, what service were we using / should we use? Where would I start to set up a new server like this? (I still have the php files and can recreate the db)
I've looked into AWS and digitalOcean, but I'm in a bit over my head and can't tell if they're offering what we need.
Any help would be appreciated. Thank you
The server was using phpmyadmin and mysql and Digital Ocean.
So you need at least a LAMP stack. With the info given we can't help you more.

Using my php scripts in Android to access database

I need some major help in setting up my android app to add/receive data to/from my database. I'm using Amazon's RDS service in connection with xampp's phpMyAdmin. I've already successfully connected my DB instance to the database in phpMyAdmin. Also, I've written my php scripts to do basic CRUD (Create, Read, Update, Delete) commands in SQL. I've been following this tutorial.
The problem for me is, in his tutorial he is using strings like this:
private static String url_all_products = "http://api.androidhive.info/android_connect/get_all_products.php";
to run his php scripts in a call to makeHttpRequest(url_all_products). But I don't have my own website to do this and I'm pretty sure I don't need one to do this.
Next, I have a test.php file that does a simple echo statement and it works when I run this in a web browser:
http://localhost/phpfiles/test.php
Which leads me to my second problem. I don't want to use localhost because I need these php files and the ability to retrieve data from the database to be accessible to anyone using my app. This is the sole reason I'm using Amazon's RDS service so my database can be accessed on the cloud.
So how can I use the host address provided to me by Amazon RDS to access the database and where do I store all the php files so I can properly use them in Android the way the tutorial shows? They are currently saved in xampp/htdocs/phpfiles/.
I feel like I'm missing some fundamental understanding of all this and I'm going about it all wrong. If someone can point me in the right direction that would make my day.
It sounds like you don't really need the XAMPP install on your local machine at all. You're hosting this on Amazon and you want it to be available to the internet, so your local computer isn't involved. You can use XAMPP locally for testing and development, but for production use you'll be exclusively on the Amazon RDS cloud.
But I don't have my own website to do this and I'm pretty sure I don't need one to do this.
You may not want a website, but you do want your services hosted on the internet. That's what your RDS instance is for, and technically the tutorial is referring to an API which happens to be exposed through a web page. This is a much better idea than opening MySQL directly to the internet on port 3306.
You'll then use your Amazon host — for which you really should use a FQDN such as api.example.com rather than the IP address, but the IP address will work just fine from a technical aspect.
The files you refer to are on your local XAMPP installation; in the xampp/htdocs/phpfiles/ folder, and need to instead be on the RDS instance.
Then your application accesses the API you expose in those files which return information back to your application.

How to connect VB.NET to Web Host

Basically, I want to create an application like this:YOUTUBE
I want to create an application that when I add some information from my web host (either PHP or MYSQL) VB.NET will read it.
From your website you'll need to insert the data into your MySQL database.
The problem with using the database provided by your web host is that the chances are, due to 'Security Reasons' the will have disabled external access.
This means that any files outside of your web server (your sites root/sub directory) will not be able to access the data. So, while your website will be able to connect without a problem, your program will not.
Some hosts give its customers the opportunity to add an IP address to a white list which enables them to bypass their security system. However, most will not give you this option.
My suggestion is that you either rent a VPS where you can run both the WebServer and Your MySQL database (and PHPMyAdmin) from or Set Up A MySQL database on your PC (its not that difficult just read the manual and youll be fine). If you had a VPS then you would no longer need your pre hosted webserver as you could run your own. You would need to point your domain name to your VPS webserver. It will act just like any other.
By running your own MySQL Databse you are given the option to enable remote access. This means that any external entity with the correct details will be able to connect.
If you cant get a VPS or don't want to run your own server or rent a server that allows for external access. Check out db4free.net .They provide you with a free MySQL Database with external access for Developers to test out their systems. They are not ultra fast so that's something you may want to be aware of. Another thing is that your data that's held can be removed at any time. The servers are not there to be used permanently just for testing.
So how do I connect to it through VB???
Good Question! To establish a connection, I suggest you use MySQL.Data library provided my DevMySQL themselves and import it into your program. Done so by Imports MySQL.Data.MySQLClient. This is written by them to work with their databases. Yes you can connect using some of the functions already in VB but in my opinion they don't work as efficiently. You'll need to download the MySQLConnector to connect as well.
Hopefully That Answers Your Questions. Any Problems Just Comment below!
Regards
Joe

Categories