Page 5 of 10
Re: video#8
Posted: Mon Dec 28, 2009 4:32 am
by hallsofvallhalla
problem is here
Code: Select all
$SQL = "INSERT into players(name, password, email, level, exper, attack, defense, hpoints, maxhp) VALUES ('$player','$password','$email','1','0','5','5','30',)";
mysql_query($SQL) or die("could not register");
you have 9 fields named but only 8 entries, add '30' on the end. it should look like this
Code: Select all
$SQL = "INSERT into players(name, password, email, level, exper, attack, defense, hpoints, maxhp) VALUES ('$player','$password','$email','1','0','5','5','30','30')";
mysql_query($SQL) or die("could not register");
Re: video#8
Posted: Mon Dec 28, 2009 11:57 am
by Tatti1234
Noup... Could Not Register =(
Wt* can be the problem?!
EDIT: YEAH! I can register, but can't login? I used new codes from video 9...
Re: video#8
Posted: Mon Dec 28, 2009 2:39 pm
by hallsofvallhalla
post authenticate.php code
Re: video#8
Posted: Mon Dec 28, 2009 4:20 pm
by Tatti1234
SH*T!! I can't! I tried your zip from video18, but it doesn't work and I am stuck now... I don't know how I return =(
Re: video#8
Posted: Mon Dec 28, 2009 4:34 pm
by hallsofvallhalla
the zip from video 18 works, it has been tested. Did you import the database dump? What is the error you are getting. If you explain your problem a little better we will be more than happy to help you.
Re: video#8
Posted: Mon Dec 28, 2009 6:51 pm
by Tatti1234
It's hard to explain because I'm not good at english...
umm... When I go to "......index.php" it says:
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\tutorial\connect.php on line 3
Could not connect to db
Re: video#8
Posted: Mon Dec 28, 2009 7:14 pm
by OldRod
Did you change the code to use your settings (hostname, database name, user, password)? If they are different from the default Localhost, etc. you'll need to modify them.
Re: video#8
Posted: Mon Dec 28, 2009 7:22 pm
by hallsofvallhalla
these will be located in connect.php
the local servers settings are located in config.php in the wamp folder
Re: video#8
Posted: Tue Dec 29, 2009 12:04 am
by Tatti1234
Umm... I did not found the config.php, but I checked connect.php, and it's that:
Code: Select all
<?php
$db = mysql_connect("localhost","root","NEWPASSWORD") or die("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("game",$db))
die("No Database Selected");
?>
Re: video#8
Posted: Tue Dec 29, 2009 12:05 am
by hallsofvallhalla
remove newpassword
should be
Code: Select all
$db = mysql_connect("localhost","root","") or die("Could not connect to db");