registration page

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
SFC
Posts: 16
Joined: Mon Apr 06, 2015 6:32 pm

registration page

Post 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?
Winawer
Posts: 180
Joined: Wed Aug 17, 2011 5:53 am

Re: registration page

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

Re: registration page

Post by hallsofvallhalla »

is this right
defence

should it be defense?
Post Reply

Return to “Beginner Help and Support”