/    Sign up×
Community /Pin to ProfileBookmark

Why Doesn’t My Calendar Work?

This is probably something really dumb but I don’t know why my calendar doesn’t work.

I followed this tutorial: [url]http://www.dreamincode.net/forums/topic/87835-event-tracking-calendar/[/url] and everything was going fine until the end and now I just get an error message: Access denied for user ‘username’@’localhost’ (using password: YES)

I suspect that the problem is that I need to change something here:
$mysql = mysql_connect(“localhost”, “username”, “password”);
mysql_select_db(“database_name”, $mysql) or die(mysql_error());
but I don’t know what to do. I tried adding the address of my server, my username and my password but it didn’t work.

Please help!

P.S. Do I need to set up a separate MySQL file?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@DariaOct 04.2011 — It may sound too obvious, but I don't know how novice - or not - you are, so, just to do the due diligence here: do you actually have the username and a password and a database name, or do you just use that generic instruction line? i.e. if your username is "joe" and password is "123" and database name is "calendar_database", would would need to replace "username", "password", "database_name" with actual values you have related to your database, so if we use what I used for example above, you would end up with

$mysql = mysql_connect("localhost", "joe", "123");

mysql_select_db("calendar_database", $mysql) or die(mysql_error());

and in addition, depending on your server settings, you may have an actual "localhost" for the database host server, or it may be something else (something like "supersqlservers.123rdb.superhost.com") - if you don't know what it is, ask your host; and if it is not localhost, then you would have to replace that value with whatever your host tells you it is.
Copy linkTweet thisAlerts:
@MyklauthorOct 04.2011 — Thank you Daria. I would have thought that my P.S. would make it obvious just how much of a php novice I am!

What you said makes sense and I'd already tried it. I've tried it again but I still get the error message. I haven't set up a MySQL database file yet but surely that can't be the reason for an 'access denied' message. Surely that just means it wouldn't function, right?
Copy linkTweet thisAlerts:
@DariaOct 07.2011 — What do you mean by "I haven't set up a MySQL database file"? You mean you have not set up the config file for the existing database, or you have not set up the database? If you are trying to connect to the database without proper credentials (database name, username, password, host) - you will get "access denied".
Copy linkTweet thisAlerts:
@MyklauthorOct 07.2011 — Thank you, I've just (about 30 mins ago) put in the info needed to get the calendar to display.

My current problem is now described here:

http://www.webdeveloper.com/forum/showthread.php?t=252046

I really am a dunce at this stuff, I've been at it for about three days.

How do I mark this thread as solved?
×

Success!

Help @Mykl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...