/    Sign up×
Community /Pin to ProfileBookmark

sql_connect username and pass

Hi all,

New to php/mysql.

When I execute the mysql_connect when a visitor either doesn’t need a login/password or doesn’t have one (like on a registration page), what username/password do I use? I found a login script on phpsense and got it to work by using a username/password I had added previously, but I don’t know what the ‘theory’ is about handling these situations. Do I setup just a random username/pass for situations like that? Am I suppose to have an anonymous user that will allow it to work in those situations? Please advise.

Thanks in advance

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@skywalker2208May 24.2008 — you set up a username and password for your script to connect to the database. When you have a user register for your site the script uses that connection to insert the info into the database.
Copy linkTweet thisAlerts:
@CFHuttonauthorMay 24.2008 — you set up a username and password for your script to connect to the database. When you have a user register for your site the script uses that connection to insert the info into the database.[/QUOTE]

Thanks for the reply.

So a username/password is created for the database just to run the script..... What kind of permissions does it get? Just whatever is necessary to add, in the registration example, new users to the members table?

Sorry for the basic questions, but I've been working with mysql for about an hour and most of that was spent just getting a few admin things done...
×

Success!

Help @CFHutton 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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