Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
mwesten1 is on a distinguished road
 
Posts: 12
Join Date: Apr 2012
Default Can't access my datatbase. - 04-15-2012, 11:16 AM

So i created database and tried to connect to it through this code:

<?php
$connect = mysql_connect('localhost','a7646966_proj','*****') ;

if(!$connect){
die('Could not connect'.mysql_error());
}

$db_selected = mysql_select_db("a7646966_projeto");
if(!$db_selected){
die('Could not select database'.mysql_error());
}

?>

this is the error i get

Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Bad Karma[CORE]'s Avatar
333 - only half evil
Bad Karma[CORE] is on a distinguished road
 
Posts: 6,476
Join Date: May 2008
Default 04-15-2012, 12:02 PM

We do not use localhost as name of the MySQL server.
To find out which MySQL server to use for your scripts to connect to the database do the following:

Login to your Control Panel
Click the "MySQL" icon.
Locate the MySQL server name to use (mysql**.000webhost.com)
Reply With Quote
(#3 (permalink))
Old
Junior Member
mwesten1 is on a distinguished road
 
Posts: 12
Join Date: Apr 2012
Default 04-15-2012, 12:56 PM

Quote:
Originally Posted by Bad Karma[CORE] View Post
We do not use localhost as name of the MySQL server.
To find out which MySQL server to use for your scripts to connect to the database do the following:

Login to your Control Panel
Click the "MySQL" icon.
Locate the MySQL server name to use (mysql**.000webhost.com)
Thankyou i'll try
Reply With Quote
(#4 (permalink))
Old
Junior Member
mwesten1 is on a distinguished road
 
Posts: 12
Join Date: Apr 2012
Default 04-15-2012, 01:11 PM

Quote:
Originally Posted by Bad Karma[CORE] View Post
We do not use localhost as name of the MySQL server.
To find out which MySQL server to use for your scripts to connect to the database do the following:

Login to your Control Panel
Click the "MySQL" icon.
Locate the MySQL server name to use (mysql**.000webhost.com)
Thankyou it helped
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com