cant access my database

delapazh

New Member
Messages
7
Reaction score
0
Points
0
hi can help me.. i cant access my database.. it seems my connection parameters are wrong..

can help me sir

here's my code:

<?php
$lochost1="delapazhigh.x10.mx;
$username1="delapazh@localhost";
$password1="mypassword";
$database1="delapazh_dbhigh";


mysql_connect($lochost1,$username1,$password1);
@mysql_select_db($database1) or die( "Unable to select database");
?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Are you trying to access this from outside of x10hosting? If so, it is not possible.

If this is a script on x10hosting, then the host name is 'localhost'
 

delapazh

New Member
Messages
7
Reaction score
0
Points
0
i already uploaded the files in x10hosting.. but i cant access the database.. tried also localhost

<?php
$lochost1="localhost;
$username1="delapazh";
$password1="mypassword";
$database1="delapazh_dbhigh";


mysql_connect($lochost1,$username1,$password1);
@mysql_select_db($database1) or die( "Unable to select database");
?>

here is the site.. >> http://delapazhigh.x10.mx/admin
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I do not see any error when I go to that page or when I try to log in.

What gives the error? What is the message? If you are getting errors, do not use @ until you solve your problems.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. Create a page with just the db login
2. run the page
3. find the error
 

think_thunk97

New Member
Messages
2
Reaction score
0
Points
0
It seemed you missed the QUOTE (")

<?php
$lochost1="delapazhigh.x10.mx";
$username1="delapazh@localhost";
$password1="mypassword";
$database1="delapazh_dbhigh";


mysql_connect($lochost1,$username1,$password1);
@mysql_select_db($database1) or die( "Unable to select database");
?>


Hope this might help.. :)
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Please use
PHP:
, [html] or [code] tags (as appropriate) to separate and format code. Note that the former two will colorize code, which will make certain errors (such as in the original sample) obvious. Compare:
Syntax error:
[php]<?php
$lochost1="localhost;
$username1="delapazh";
$password1="mypassword";
$database1="delapazh_dbhigh";


mysql_connect($lochost1,$username1,$password1);
@mysql_select_db($database1) or die( "Unable to select database");
?>

No error:
PHP:
<?php
$lochost1="localhost";
$username1="delapazh";
$password1="mypassword";
$database1="delapazh_dbhigh";


mysql_connect($lochost1,$username1,$password1);
@mysql_select_db($database1) or die( "Unable to select database");
?>

The mysql extension is outdated and on its way to deprecation. Instead, use PDO, which has many useful improvements, such as prepared statements and support for the Traversable interface, so you can loop over results with foreach. If you need a PDO tutorial, try "Writing MySQL Scripts with PHP and PDO".

Don't use die when outputting HTML. You'll get invalid HTML.
 
Top