LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 03-18-2002, 06:39 PM   #1
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Rep: Reputation: 30
PHP Adding Passwords to connection line


I am trying out this simple piece of code in a php file:

$db = mysql_connect("localhost","root" );

lets say i have a password called "unworthy77" to connect with my MySQL server (thats not what it is, so dont worry about it...) how would i add that into the line above and what would be the proper syntax for it?
 
Old 03-18-2002, 10:06 PM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
I'd suggest creating another user so you don't have to use root.

Code:
mysql_connect( "localhost", "user", "password" )
          or die ("Unable to connect");
 
Old 03-18-2002, 10:38 PM   #3
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
thanks for the tip and howto homey...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create hashed passwords in PHP ? ALInux Programming 1 11-12-2005 08:45 AM
Adding a line to file mikz Linux - General 2 03-03-2005 01:35 PM
php & shadow passwords rblampain Linux - Security 7 12-17-2004 11:55 PM
adding users and passwords to mysql caged Programming 1 10-27-2004 06:22 PM
adding line to /etc/ld.so.conf jotus Red Hat 3 10-13-2003 06:49 AM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration