need help regarding connection...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

need help regarding connection...

Post by itsmani1 »

Code: Select all

$server = "localhost"; 
$username = "mysql_user";
$password = "";
$db = "temp";
$link = mysql_connect($server, $username ,$password) or die("Could not connect: " . mysql_error());
mysql_select_db($db) or die(mysql_error());
in above code passowrd field is blank, if i put password what will happen and moreover if i use password wot will be its effect? and same quetion about username? if i change it?
2nd thing i wana know that if i upload this connection file is there any need to made any change in this code remember:
Databse is Temp

I m using phptriad2-2-1
and my last question is can i use php5's code on it? will it work for it?
Last edited by itsmani1 on Fri Sep 17, 2004 3:30 am, edited 4 times in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't understand your questions, at all.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

feyd wrote:I don't understand your questions, at all.
this is the question abt above code?


in above code passowrd field is blank, if i put password what will happen and moreover if i use password wot will be its effect? and same quetion about username? if i change it?


got it wot i mean?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

repeating your questions don't help me understand what you're actually trying to ask.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Code: Select all

<?php

$server = "localhost";
 $username = "mysql_user";
$password = "";
$db = "temp";
$link = mysql_connect($server, $username ,$password) or
 die("Could not connect: " . mysql_error());
mysql_select_db($db) or die(mysql_error());
?>

this code of my connection file. did u got wot i mean till now? if yes then ...
u can see $password = ""; now wot i want is i want to set some value against password like this $password = "1111"; tell me will it work?
if not then Y?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

having the password set is entirely up to your mysql server's permissions and settings for the user. So, it could work. It entirely depends on the user's settings.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

feyd wrote:having the password set is entirely up to your mysql server's permissions and settings for the user. So, it could work. It entirely depends on the user's settings.
how can i change permissions?????
Last edited by itsmani1 on Fri Sep 17, 2004 4:13 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you'd need administrator/root access on the mysql server.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

m using win2k not linux
????????????????
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

same answer.. you need a superuser account in mysql to change the permissions of any other users mysql has.
Post Reply