LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP Adding Passwords to connection line (https://www.linuxquestions.org/questions/programming-9/php-adding-passwords-to-connection-line-16547/)

Chijtska 03-18-2002 05:39 PM

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?

crabboy 03-18-2002 09:06 PM

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");


Chijtska 03-18-2002 09:38 PM

thanks for the tip and howto homey...


All times are GMT -5. The time now is 10:33 AM.