Wamp Server

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
SoalSlayer
Posts: 12
Joined: Fri Mar 05, 2010 4:14 pm

Re: Wamp Server

Post 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
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Wamp Server

Post by Jackolantern »

Looks good, except I think I see a typo:

Code: Select all

if(!mysql_select_db("test=,$db"))
It looks like you accidentally added a "=", and you also need to reformat the parameters a bit as well. Instead, it should look like:

Code: Select all

if(!mysql_select_db('test', $db))
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!
The indelible lord of tl;dr
SoalSlayer
Posts: 12
Joined: Fri Mar 05, 2010 4:14 pm

Re: Wamp Server

Post 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 =]
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Wamp Server

Post 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
SoalSlayer
Posts: 12
Joined: Fri Mar 05, 2010 4:14 pm

Re: Wamp Server

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Wamp Server

Post by hallsofvallhalla »

i have also found the wamp forums are a good source for wamp related issue.
SoalSlayer
Posts: 12
Joined: Fri Mar 05, 2010 4:14 pm

Re: Wamp Server

Post 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
SoalSlayer
Posts: 12
Joined: Fri Mar 05, 2010 4:14 pm

Re: Wamp Server

Post 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
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Re: Wamp Server

Post by jpoisson »

is it saying could not connect or that there is no database at all?
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Wamp Server

Post 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.
The indelible lord of tl;dr
Post Reply

Return to “Advanced Help and Support”