Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does mysql_connect() not work with 000webhost [closed]

Tags:

php

mysql

I wanted confirmation if you can't use MySQL_connect with 000webhost.

They say the "remote connections" to MySQL are disabled, but I couldn't find what "remote connection" really means after doing some research. Does anyone know for sure if it won't work?

like image 728
newspaperofthepeople Avatar asked Jan 18 '26 18:01

newspaperofthepeople


1 Answers

Remote connections are different from your API.

mysql_connect("localhost","user","pass"); 

Is alot different from:

Your Server IP: 98.568.321.210 For example.

mysql_connect("98.568.321.210","user","password");

The second example is blocked because you are attempting make a connection from a remote server, which is not localhost/127.0.0.1

So overall, yes although not recommended, you can use mysql_* functions.

I would recommend looking into mysqli or pdo due to mysql being depreciated.

like image 75
Daryl Gill Avatar answered Jan 20 '26 08:01

Daryl Gill