Hey guys,
So here's my issue, im doing some work for a client. and am finalizing the site by including the database information; however, i can't seem to connect to the database, which brings me to my question.
Using mysqli in php. how come the only thing you can connect to is localhost? everytime i've tried an actual URL it won't connect to the database. I always end up getting this error.
Warning: mysqli_real_connect(): [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti (trying to connect via tcp://serverName:port)
i know why im getting the error. but it seems no matter which way i try to connect, it doesn't work. has anybody run into this problem as well? and if so, did you find a way around it?
I know you can work around it by placing this code on the local machine where the database is and changing the connection to localhost. but im not at that point yet and need to be able to connect outside of the local machine. any ideas?