PDA

View Full Version : updating connections in localhost.php


berndrendic374326
06-23-2009, 07:59 PM
hey guys I have finally managed to create database etc but i am now having problems with updating conections in localhost php part ... ok here is the code , can someone tell me what am i suposed to put here...

i am on wamp server doing it localy and normally i test my site on http://localhost/

so do i type localhost in $hostname_localhost line

what about $database_localhost? is that the name i gave to my database in myadmin php?
and $username_localhost whats that?
is that the admin name i put in wa globals in line 24? or something else

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "";
$username_localhost = "";
$password_localhost = "";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
?>



I keep getting this error msg ;

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\hfsss\Connections\localhost.php on line 9


thanks in advance

Ray Borduin
06-24-2009, 08:01 AM
$hostname_localhost = "localhost";
$database_localhost = "";
$username_localhost = "";
$password_localhost = "";

you need to have a value for your database name username and password. Those can't be left blank.

berndrendic374326
06-24-2009, 09:08 AM
Thanks for reply i Ve got it working ...

if you use User reg park as it is without re-naming anything in it then this is what works for me ;

$hostname_localhost = "localhost";
$database_localhost = "mysql";
$username_localhost = "root";
$password_localhost = "";


and password .... not needed to get it run