Jump to content

Doubt in sql please solve my problem


Net123
 Share

Recommended Posts

Hi i have start's learning sql from w3schools now i have question in that ?I have 4 thing's in my hand 1)database name2)database user3)database password4)host(localhost)but here three thing's only found how can i solve this ?mysql_connect("your.hostaddress.com", "username","password")

Link to comment
Share on other sites

Hi i have start's learning sql from w3schools now i have question in that ?I have 4 thing's in my hand 1)database name2)database user3)database password4)host(localhost)but here three thing's only found how can i solve this ?mysql_connect("your.hostaddress.com", "username","password")
$con = mysql_connect("localhost","dbusername","dbpass");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("dbname", $con);

Edited by Greysoul
Link to comment
Share on other sites

You select the database using mysql_select_db(). One database server may hold many databases.As for user settings, sure, but you'll still need some way to identify them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...