wipe Posted June 8, 2006 Share Posted June 8, 2006 Hi guys,i have 2 questions:First- I'm trying to use an external SQL DB like this:connect.php[code]<?$dbhost = 'mysite.com';$dbuser = 'user';$dbpass = 'pass';$dbname = 'db_name';$dbcfg = 'vehicle_config';$dbvin = 'vehicle_inventory';$dbimg = 'vehicle_imagelist';?>[/code]in index.php everything works fine but when go to the second page (view.php) he lose the connection. I use the "Require" but return a DB problem.[i]Warning: mysql_connect(): Access denied for user 'wipe_msl'@'biham.lunarpages.com' (using password: YES) in /home/acomp2/public_html/mslacomp/view.php on line 6I cannot connect to the database because: Access denied for user 'wipe_msl'@'biham.lunarpages.com' (using password: YES)[/i]But this is the pass that a have chosed.Can this be a security problem or just a script error?----------------------------------------2nd question:how can i connect to several DB(in diferent hosts) and display as just one?do i need some special connect? Do i need a script adjustment?Best regards,Wipe Quote Link to comment https://forums.phpfreaks.com/topic/11531-phpmysql-connect/ Share on other sites More sharing options...
poirot Posted June 8, 2006 Share Posted June 8, 2006 1. Odd... It works for one page but not for another?2. You can have different MySQL links but I never used this:[code]$link1 = mysql_connect('host', 'user1', 'pass1');$link2 = mysql_connect('host2', 'user2', 'pass2');[/code]But this is an annoyance since you'll have to define the link to use for everything you do:[code]mysql_query("SELECT * FROM table", $link1)[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11531-phpmysql-connect/#findComment-43409 Share on other sites More sharing options...
wipe Posted June 8, 2006 Author Share Posted June 8, 2006 [!--quoteo(post=381619:date=Jun 8 2006, 11:08 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 8 2006, 11:08 PM) [snapback]381619[/snapback][/div][div class=\'quotemain\'][!--quotec--]1. Odd... It works for one page but not for another?2. You can have different MySQL links but I never used this:[code]$link1 = mysql_connect('host', 'user1', 'pass1');$link2 = mysql_connect('host2', 'user2', 'pass2');[/code]But this is an annoyance since you'll have to define the link to use for everything you do:[code]mysql_query("SELECT * FROM table", $link1)[/code][/quote]Thats right. Works for the first page but not for the second. Quote Link to comment https://forums.phpfreaks.com/topic/11531-phpmysql-connect/#findComment-43413 Share on other sites More sharing options...
Fyorl Posted June 8, 2006 Share Posted June 8, 2006 are you using mysql_connect() or mysql_pconnect()? You might also want to post a support ticket to your web hosts asking why you're receiving access denied messages... Quote Link to comment https://forums.phpfreaks.com/topic/11531-phpmysql-connect/#findComment-43418 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.