Support Forums

How does PHP connection works if I deploy a site folder with that kind of code?

I’m new to web coding in general, and new to using this program to deploy my tests, so I just wanted a small help.
I’m creating a fake e-commerce website for college and I’m upgrading a old code to have PHP code to connect to a SQL database and stuff like that. How exactly would that connection work if I deployed my site here? (I use Drag & Drop deploys cause they’re easier) Would I need to create the database somewhere else?

Hi @just_a_beginner,

You’d have to do a lot of re-writing. I think creating a database elsewhere like Firebase DB, FaunaDB, etc. might be a better option as they are specialised in being used with NodeJS environments.

However, I’d also advise against drag-n-drop deploys as database connections are usually made in Netlify Functions to keep your database API keys a secret.

thanks for the tip! It’s just that idk how to use the other forms of deploy
all my other “sites” are just simple html created as tests, so is that one, so nothing really is happening behind the scenes, but I would love to know how the other ways work so everything works fine

Hi @just_a_beginner,

The other methods are not so complicated either. Considering you’re using Git, all you need to do is connect the repo to Netlify and the rest would be fairly easy too.

To comment on the exact settings that you’d need, I’d actually have to see your code or repo.

I never used Git before, but I’ll try to learn for this case, since all my other works had no back-end and they were safe to drag and drop.
unfortunately, I dont have the code done yet, i just wanted to know if it would work in here before i tried and failed by doing something wrong or had to try another place, which I didn’t really want to

Sure, Git is no way a requirement, but you’d anyways probably love using it once you do.

If your projects are just educational purposes and if security is not a primary concern, you can get away with manual deploys too.

yes, all of my projects so far have been educational only, and none of them have back-end, so I believe theres no reason to worry about security with them. I will use Git for the one that will have a back-end, though, to practice with it and be extra safe
Thanks for the help!