Trying to use php files to query / insert data into SQL database

Angel Dev 1 Reputation point
2023-01-10T19:29:48.24+00:00

Hello I have bought a subscription for an Azure SQL database AND a web app + database. I am not sure which suits my needs. I have a Unity Game and I am trying to use Azure and SQL to store users and scores. Unity has a class called UnityWebRequest which uses URLs (www.example.com/getuser.php) to post and get data. I have my php code written, I have my database, and I have my game. My problem is that I do not know where to put my php files so that my game can access them to connect to the database. Can i link my php files on my web app? Can they be accessed through the SQL database? Any help is greatly appreciated. :)

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Bjoern Peters 8,921 Reputation points
    2023-01-11T01:24:37.643+00:00

    Hi @Angel Dev

    Maybe you should start here, with the basics... how to deploy a PHP web app. https://learn.microsoft.com/en-us/azure/app-service/quickstart-php?tabs=cli&pivots=platform-linux

    From this point, you can get ahead... deploy your PHP code and connect it to your Azure SQL DB.

    Another option could be... using this tutorial... how to deploy, connect and configure that given PHP example with a MySQL DB https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app

    I hope my answer is helpful to you,

    Your Bjoern Peters

    If the reply was helpful, please upvote and/or accept it as an answer, as this helps others in the community with similar questions. Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.