Page 1 of 1

registration page

Posted: Mon Apr 27, 2015 12:45 pm
by SFC
I get error when try to registrate following one of old youtube videos. To make things short, I get error: "could not register" which comes from reguser.php, from code:

$SQL = "INSERT into players(username, password, email, level, exper, attack, defence, hpoints, maxhp, spoints, maxspoints) VALUES ('$player','$password','$email','1','0','$classquery3[attack]','$classquery3[defence]','$classquery3[hpoints]','$classquery3[hpoints]','$classquery3[spoints]','$classquery3[spoints]')";
mysql_query($SQL) or die("could not register");

But page stays on register.php, if that help anything...

connect.php is:

<?php
$db = mysql_connect("localhost","967798","******") or die("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("967798",$db))
die("No database selected");
?>

Before I used different registration page, but when I try to insert tabels for classes, I encounter some dificutlys and decide to switch to this from youtube than came across this error.
Thoughts?

Re: registration page

Posted: Tue Apr 28, 2015 7:09 am
by Winawer
Use mysql_error to see why the query is failing.

It's also a good idea to output the query itself to see that it actually looks like you think it looks like.

Re: registration page

Posted: Tue May 19, 2015 2:37 pm
by hallsofvallhalla
is this right
defence

should it be defense?