Jump to content

help with mysql_connect


darkfreaks

Recommended Posts

i think this has to do something with me dropping my table and trying to reinstall the blog but now i get

 

 

"can't connect to mysql5.000webhost.com"

 

so then i tried using localhost and i get...

 

"can't connect to localhost using password YES"

 

so i assume my password is right and for some reason it isnt connecting yet all the variables match up correct password, database,user i double and triple checked spelling  :wtf:

Link to comment
https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/
Share on other sites

"can't connect hostname.domain.com" isn't a standard error, you should echo the real error.

 

Your password isn't necessarily correct.  Why do you believe this host (or your local machine) have MySQL installed and running?

 

-Dan

  Quote
i dropped  everything from the table.
This sentence is invalid.  You can either DROP a table, or DELETE everything from the table.  You cannot "drop" data, only tables.  What query did you run?  What button did you push?

 

If you're saying you deleted the table "users' under the database "mysql," then you've deleted your own accounts.  You cannot log in without a user table. 

 

-Dan

mine is more like this

 

define ('DB_USER', '****');
define ('DB_PASSWORD', '****');
define ('DB_HOST', '****');
define ('DB_NAME', '****');

$dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to MySQL: ' . mysql_error());
mysql_select_db (DB_NAME) OR die('Could not select the database: ' . mysql_error());

 

also i recreated the table deleted it hoping it would just bring up the setup file but i still get connect errors

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.