2767
צפיות
צפיות
6
תשובות
תשובות
mysql_connect – non stop waiting for locallhost… message
Hi
I am a new PHP dev .
Using Wamp and trying to connect to mysql
The function I am using is :
$connection = mysql_connect("localhost:8080", "root", "password");
for some reason It loads all of the pages that I created normally and only when this code is there it keeps on loading the page and the browser presents the message waiting for locallhost …
Any idea anyone ?
6 תשובות
Maybe it's because there is missing data base
try to do this:
$connection = mysql_connect("localhost", "root", "password", "database");
I have created a database and tried the alternative mysql_connect command but nothing yet …
I think that the problem is with the Wamp settings and the fact that I had to change it
from port 80 to port 8080
and from 3306 to 3307
its just a hunch though …
We have an answer ! 🙂
I needed to change the code to include
localhost:3307 instead of localhost:8080
this happens because I tried to login to the new mysql port (3307) that I created and not the default one which is 3306
להבא, http://php.net/mysql_error
יעזור לך להתמודד מול שגיאות יותר מובנות לטיפול.
בהצלחה 🙂
DO NOT USE Mysql_* functions; they're deprecated. Use MySQLi or PDO. There are a lot of tutorials about them on the web. Just google one of them. (Use MySQLi only if you're gonna use MySQL database.)