New to MySQL & PHP, thankfully not so new to databases. Need to get my brain wrapped around a concept and have a kick in the right direction. I have a database up, wish to allow members of my org to select from the database to see a list of names, etc. Scripts will be in a password protected directory on hosted web site. Problem is this: how do I allow connection to database? I can't obviously include my username/pwd in the scripts. I cannot create a generic account as per my host's own rules, or I'd create one with limited permissions, etc. and put that info in the script. So, how can I allow access to the database without a username/pwd? I've worked on huge applications like PeopleSoft running on SQL Server, DB2, etc, and I've always had to perform some login ritual before I could do anything.
I've not written any PHP code yet, just thumbed through some, but this concept has me befuddled. Help?
Selecting Data - connecting to db
Moderator: General Moderators
you have to provide a valid username/password to mysql_connect (unless the default values described in the manual do fit) and they have to be in plain text in the script.
As long as the php-parser is on, no one will see the script source.
mysql stores it's own user table so there's no need the user exists as system user.
As long as the php-parser is on, no one will see the script source.
mysql stores it's own user table so there's no need the user exists as system user.
sorry.
As long as your script is parsed by the webserver or the commandline version of php.
The difference between <?php phpinfo(); ?> results in the php configuration/credits page or an empty page (containing the plain text in "source view") in a webbrowser. Nevermind, as long as your server is configured properly no one shall see the plain script data
As long as your script is parsed by the webserver or the commandline version of php.
The difference between <?php phpinfo(); ?> results in the php configuration/credits page or an empty page (containing the plain text in "source view") in a webbrowser. Nevermind, as long as your server is configured properly no one shall see the plain script data
the day ended 6 and half an hour ago (at least here in good ol' germany).
Seems to be "I'm not a teacher"-week.
take a look at php - Letter
OMG, I should stop before someone gets hurt.
My next and only goal is to prevent it from becoming "can't express anything"-month
edit & btw: Ultimate: besides squash the best sport in this century (most likely
)
Seems to be "I'm not a teacher"-week.
take a look at php - Letter
OMG, I should stop before someone gets hurt.
My next and only goal is to prevent it from becoming "can't express anything"-month
edit & btw: Ultimate: besides squash the best sport in this century (most likely