Browser MMO video #8

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: video#8

Post 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");
Tatti1234
Posts: 10
Joined: Sun Dec 27, 2009 6:30 pm

Re: video#8

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

Re: video#8

Post by hallsofvallhalla »

post authenticate.php code
Tatti1234
Posts: 10
Joined: Sun Dec 27, 2009 6:30 pm

Re: video#8

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

Re: video#8

Post 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.
Tatti1234
Posts: 10
Joined: Sun Dec 27, 2009 6:30 pm

Re: video#8

Post 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
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: video#8

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

Re: video#8

Post by hallsofvallhalla »

these will be located in connect.php


the local servers settings are located in config.php in the wamp folder
Tatti1234
Posts: 10
Joined: Sun Dec 27, 2009 6:30 pm

Re: video#8

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

Re: video#8

Post by hallsofvallhalla »

remove newpassword

should be

Code: Select all

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
Post Reply

Return to “Older Browser MMO Videos”