Local server help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Local server help

Post by Smackie »

I set up a local hosting (wamp) on my system so i could use it as a testing server so i can setup alot of my scripts and make them all work and all but for some reason i get this error when i try connecting to MySQL can someone help me?

Code: Select all

Warning: mysql_pconnect() їfunction.mysql-pconnect]: Access denied for user 'dbuser'@'localhost' (using password: YES) in c:\program files\e-novative\WAMP\www\db.php on line 11
Couldn't connect to server.

db.php

Code: Select all

<? 
/*  Database Information - Required!!  */
/* -- Configure the Variables Below --*/
$dbhost = 'localhost';
$dbuser = 'username';
$dbpasswd = 'password';
$database = 'databasename';

/* Database Stuff, do not modify below this line */

$connection = mysql_connect("$dbhost","$dbuser","$dbpasswd") 
	or die ("Couldn't connect to server.");
	
$db = mysql_select_db("$database", $connection)
	or die("Couldn't select database.");
?>
line 11

Code: Select all

$connection = mysql_connect(&quote;$dbhost&quote;,&quote;$dbuser&quote;,&quote;$dbpasswd&quote;)
Thank you
Smackie
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I assume you created a user account for the user to access the mysql server?

can you access the db from the command line?
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

yes i can access the database and yes i have a username and password for it too...
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

according to your warning, ur using pconnect, but your code above shows you only using connect?

care to ensure you have posted the correct code/error? thanks
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

never mind about that i got that working :-\ :? i just uninstalled it reinstalled it and its working but i got a new problem :? so of my stuff that i use in php shows up like this and alot of other ways

Code: Select all

Notice: Undefined index: op in c:\program files\e-novative\WAMP\www\join.php on line 14
What can be causeing this?

..........
Smackie
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

trying to access things that are in $_GET (or $_POST) that don't exist?
Post Reply