rite2inno Posted April 29, 2006 Share Posted April 29, 2006 I was just Experimenting on the tutorial I just read. ANd I found out I do not have a db.php file. Can someone please explain how I could go about this?<?phpmysql_connect("localhost","username","password") or die ("Unable to connect to MySQL server."); $db = mysql_select_db("name_of_database") or die ("Unable to select requested database."); ?>But I am afraid I do not know how to replace the contants. Can some one do that for me?The database username is "Clienty" and the password is "clienty"But I do not know the host, or whta it looks likeCould this be it? *http://mysqladmin.fatcow.com/mysqladmin/main.php?*OR *http://mysqladmin.fatcow.com/mysqladmin/db_details_structure.php?db=clienty*what could be my local host? I need an example. if my site is abc.com----------------------------------------------------------Notin much'Just me' Quote Link to comment Share on other sites More sharing options...
Ph0enix Posted April 29, 2006 Share Posted April 29, 2006 Ok i dont know much on php so i probably wont help a lot, but when iv used a webhost and created a database it has given me the server name. so for example im using freehostia so the servername they gave me was mysql2.freehostia.com. My username is Ph0enix and my password is Ph0enix2 and my database is Ph0enix_db. so when im connecting to my database i would put [code]<?phpmysql_connect("mysql2.freehostia.com","Ph0enix","Ph0enix2") or die ("Unable to connect to MySQL server.");$db = mysql_select_db("Ph0enix_db") or die ("Unable to select requested database.");?>[/code]I also had a website on tripod.lycos.co.uk and for that i just used "localhost" but sometimes you use "127.0.0.1" instead.So just try a few different things and make sure you havent made little mistakes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.