Page 2 of 3
Re: Wamp Server
Posted: Fri Mar 05, 2010 10:24 pm
by SoalSlayer
Ok thx just to check so instead of the old code it would be something like this ?
Code: Select all
<?php
$db = mysql_connect("localhost","Username","Password") or die("Could not connect to db");
if (!$db)
die ("no db");
if(!mysql_select_db("test=,$db"))
die ("No database Selected");
?>
im not sure if thats right of not but like i said in the begining im still learning at this so sry for all the hassel
Re: Wamp Server
Posted: Sat Mar 06, 2010 12:05 am
by Jackolantern
Looks good, except I think I see a typo:
It looks like you accidentally added a "=", and you also need to reformat the parameters a bit as well. Instead, it should look like:
The extra space between the parameters isn't mandatory, but it makes it easier to read

And it is no hassle at all. Answering questions is what most of these forums are about!
Re: Wamp Server
Posted: Sat Mar 06, 2010 12:31 am
by SoalSlayer
Ahhhh thx alot for that i didnt even realise it was wrong, ill try again see if i can get things working tomoz after work thx for all the help =]
Re: Wamp Server
Posted: Sat Mar 06, 2010 1:12 am
by hallsofvallhalla
sorry for the late delay, Jp I actually asked him to post this here, I didn't have the time to help.
So can you find the page now? To test it just simple place nothing but the word TEST on test.html, save it in the wamp\www folder and try to open it
localhost\test.html
if that works then do the same for a test.php, if that works then you are good to go. If not then make sure wamp is in white in the icon in the bottom corner
Re: Wamp Server
Posted: Sat Mar 06, 2010 10:04 am
by SoalSlayer
Nope i tried that again throught wamp still giving me the same message tried on firefox and IE later on ill post some screenshots of the file locations ect and the page telling me it wont connect =[ everything is online and should be working i just dont understand why not =[
thx
Re: Wamp Server
Posted: Sat Mar 06, 2010 2:53 pm
by hallsofvallhalla
i have also found the wamp forums are a good source for wamp related issue.
Re: Wamp Server
Posted: Sat Mar 06, 2010 10:34 pm
by SoalSlayer
sorry for the late reply, been at work all day.
Cool ill have a look throught it have you got the link ?
thx
Re: Wamp Server
Posted: Sat Mar 06, 2010 11:11 pm
by SoalSlayer
i have managed to get the codes working on my own website the only problem is its still not connecting to the database somehow still comes back with no database selected, im sure all the paths are correct the username and password are in i have tried every way around it i can think of just dont know where im going wrong on this :S
Re: Wamp Server
Posted: Sat Mar 06, 2010 11:42 pm
by jpoisson
is it saying could not connect or that there is no database at all?
Re: Wamp Server
Posted: Sat Mar 06, 2010 11:59 pm
by Jackolantern
Try creating a new user and immediately put the credentials into your connect script. Maybe there was a difference in the password.
Also, check with your web host and double check what your MySQL host should be. While it is oftentimes "localhost", your host may have separate servers set up for both web serving and MySQL.