asmith Posted January 19, 2008 Share Posted January 19, 2008 these names has made me so messed up . when i study php on my computer , i had localhost and mysql been set up ... i had a username and passwords for "entering" mysql , then after logging i gave a user privilage for php coding like : mysql_connect("localhost","user","pass"); and i had created database with names "user" , "site_info" IN THE mysql . and so on ... the confussion i have now is : i've get a hosting package , it has said i can have 3 mysql databases. first question is i can have 3 databases IN mysql database ? (like my "user" and "site_info" ) OR i can have 3 copy of the mysql database (3 mysql softwares?) my site works with cpanel. in the mysql link , there is "create database" part . i let me create 3 databases, i tried to create more ,but it said i have my 3 databases, now in there i can create users with password and add them to these databases . when i added database "test1" , it added "mydomain_test1" . now in all php pages i've write, for example there are mysql_select_db("test1") , i should change all to mysql_select_db("mydomain_test1") (assumin i can have 3 databases INSIDE one mysql database ) ... !!!? !!? !!?!?! (please talk in my language , like 3 IN one mysql , or 3 mysql copies . .so i can understand .. thanks in advance) Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/ Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 when i added database "test1" , it added "mydomain_test1" . now in all php pages i've write, for example there are mysql_select_db("test1") , i should change all to mysql_select_db("mydomain_test1") (assumin i can have 3 databases INSIDE one mysql database ) ... You need to give mysql_select_db() the actual name of your database, i.e. mydomain_test1. first question is i can have 3 databases IN mysql database ? (like my "user" and "site_info" ) When you've created the database then you can have as many tables as you would like inside that database. (please talk in my language , like 3 IN one mysql , or 3 mysql copies . .so i can understand .. thanks in advance) Seeing as you have a curious way of using punctuation and spacing I don't think that will be possible Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443510 Share on other sites More sharing options...
asmith Posted January 19, 2008 Author Share Posted January 19, 2008 thanks for replying , the thing i think has made me confused here is i can have as many databases here on my localhost in mysql database, using : create database example1 then in those databases i can have as many tables i want to . so in mysql in localhost can have infinite databases with infinite tables . but now i'm being limited to 3 databases, that was the point ... so , i have to search all the codes and made every "test1" to "mydomian_test1" ?? Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443523 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 Yes, but you should consider connecting in one file and then perhaps include that file. Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443533 Share on other sites More sharing options...
asmith Posted January 19, 2008 Author Share Posted January 19, 2008 sorry , i didn't what you mean. :-\ could you please say it in a different way ? Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443539 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 Well, you could do <?php $link = mysql_connect('localhost', 'user', 'pass'); mysql_select_db('database'); ?> And then include that file. Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443540 Share on other sites More sharing options...
asmith Posted January 19, 2008 Author Share Posted January 19, 2008 yea got it , the connection line will be still ; mysql_connect("localhost" ... , still localhost in this line ? Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443545 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443546 Share on other sites More sharing options...
asmith Posted January 19, 2008 Author Share Posted January 19, 2008 thanks daniel ! thanks a ton! Quote Link to comment https://forums.phpfreaks.com/topic/86744-solved-confusion-with-names/#findComment-443550 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.