New User...Error cannot connect DB

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /storage/ssd4/948/3399948/public_html/checklogin.php:5 Stack trace: #0 {main} thrown in /storage/ssd4/948/3399948/public_html/checklogin.php on line 5

Can help me

Use PDO instead :slight_smile:

1 Like

Original File
mysql_connect(ā€œlocalhostā€,ā€œrootā€,"") or die(ā€œCannot connect to serverā€);
mysql_select_db(ā€œdataā€) or die(ā€œCannot select Databaseā€);

Edit
mysql_connect(ā€œdatabases.000webhost.comā€,ā€œrootā€,ā€œ123456ā€) or die(ā€œCannot connect to serverā€);
mysql_select_db(ā€œid3399948_dataā€) or die(ā€œCannot select Databaseā€);

Is this a script youā€™ve wrote or a premade one?

original file in my script
can u help meā€¦
i never use free webhost to publish my systemā€¦but now i have to publish my systemā€¦
i cannot connet DBā€¦:sob::sob::sob::sob:

Try heading to ā€œGeneral Settingsā€ on 000webhost.com and selecting a lower PHP version.

okā€¦i set lower PHP versionā€¦
i get error Warning: mysql_connect(): ProxySQL Error: Access denied for user ā€˜rootā€™@ā€˜2a02:4780:bad:f00d::eā€™ (using password: YES) in /storage/ssd4/948/3399948/public_html/checklogin.php on line 5 Cannot connect to server

in my localhost NOT use password

but in webhost i set password 123456 but i still get that errorā€¦i change use and no password still get error

mysql_connect(ā€œlocalhostā€,ā€œrootā€,"") or die(ā€œCannot connect to serverā€);
mysql_select_db(ā€œid3399948_dataā€) or die(ā€œCannot select Databaseā€);

You canā€™t use root

host is localhost

username/database names are under Manage Database as well as passwords at 000webhost.com

okā€¦but i still get errorā€¦new error from another pageā€¦i have change my coding all page?ermā€¦i get tired coz thatā€¦

Notice: Use of undefined constant username1 - assumed ā€˜username1ā€™ in /storage/ssd4/948/3399948/public_html/menu_user.php on line 4 Parse error: syntax error, unexpected T_STRING in /storage/ssd4/948/3399948/public_html/sqlconn.php on line 6