Databse & Subdomains

liunx

Guest
i'm trying to install a script on a subdomain and am getting the following error on the create file: "Unable to select database"<br /><br />the config file has the following:<br /><br />$dbhost = "localhost";// usually this is localhost but if it doesn't work, check with your hosting provider<br />$dbname = "dbname";// the name of the databse you want to put the phpFanBase tables in<br />$dbuser = "username";// your MySQL username (must have access to database above)<br />$dbpass = "password";// your MySQL passwor<br /><br />assuming i've created the dtabase "name"<br />with the username "name2"<br />and the password "pw100"<br /><br />what values do i put there to get the script to connect to the database? in my cp panel, the database is showing up as domain_name<br /><br />and the user is showing up as "domain_name2"<br /><br />but when i tried those values it didn't work. it didn't work without the domain_ either. i'm relatively new to php and mysql, but i have gotten this script to work on another domain, so, please help? someone?<br /><br />thanks<!--content-->
for dbase name are you using cpanelname_dbasename<br />and for username cpanelname_username<br /><br />Also, did you assign a user to the database you created? If you didnt you need to do that first vis manage mysql in your coanel<!--content-->
<!--QuoteBegin-domynoe+Nov 3 2003, 08:20 AM--><div class='quotetop'>QUOTE(domynoe @ Nov 3 2003, 08:20 AM)</div><div class='quotemain'><!--QuoteEBegin-->$dbhost = "localhost";// usually this is localhost but if it doesn't work, check with your hosting provider<br />$dbname = "dbname";  // the name of the databse you want to put the phpFanBase tables in<br />$dbuser = "username";// your MySQL username (must have access to database above)<br />$dbpass = "password";// your MySQL passwor<!--QuoteEnd--></div><!--QuoteEEnd--><br />This is off the top of my head, but I think it's correct: When you specify the database name and user name, you need to preface them with your cpanel login. I think this is because of the shared hosting setup. So, assuming your cpanel name is foobar, your username is joe, and the database is dbase, your username and database name would look like (include the underscores):<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$dbname = "foobar_dbase";<br />$dbuser = "foobar_joe";<!--c2--></div><!--ec2--><br /><br />Be sure to create the matching user and the database in cpanel -- and you should be all set to go. <br /><br />-Alan<br /><br />PS: Edit: Doh! MikeH beat me to it!<!--content-->
yea, created the database saxykam, and gave it the user name saxykam. in my cpanel, they're showing up as:<br /><br />database: domynoe_saxykam<br />username: domynoe_saxykam<br /><br /><br />that's originally how i put them in the script and it came up with the unable to select a database error.<br /><br />sigh . . . . i'll try it again.<!--content-->
Have you selected the username to the database rather then just created it?<br /><br />Jim<!--content-->
doh!<br /><br /><br />that was the problem. thanks. since it was showing up next to the databse name i assumed the use was already ssigned. *smacks forehead*<br /><br /><br /><br />told you i was new at this php/mysql thing. give me html and ssi and all that and i'm fine. lol<!--content-->
Hi,<br /><br />No worries, we all do it!<br /><br />Jim<!--content-->
<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/kicking.gif" style="vertical-align:middle" emoid=":dance:" border="0" alt="kicking.gif" /> Welcome to the family <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/kicking.gif" style="vertical-align:middle" emoid=":dance:" border="0" alt="kicking.gif" /> <br /><br />thats a beautiful site you have!<br /><br />Hope you will bea regular here,<br />we really are just like family here.<!--content-->
thank you. i'm quite proud of it.<br /><br />i'm actually quite the busy girl between my personal forums, my writing group forums, some market forums, my writing, my 4 websites, my children's and husband's websites, ummm . . . yea. i'll see about poking about once in awhile, but don't count me as a regular. lol<br /><br />and speaking of writing, off to get some done. yay.<br /><br />thanks again for the help. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Back
Top