Jump to content

[SOLVED] Problem adding data to my database


Gizzer

Recommended Posts

Hes my site that I used my code on ...

 

http://testgame.awardspace.co.uk/signup.php

 

But it doesnt send the data to the database when I click register.

 

heres my code.

 

$pas = $_POST['password'];

$pass = sha1($pas)

$user = $_POST['username'];

$email = $_POST['email'];

$charname = $_POST['charactername'];

$passcheck = $_POST['confirmpassword'];

$emailcheck = $_POST['confirmemail'];

 

$connection = mysql_connect("*****") or die("Couldn't connect to databse");

mysql_select_db("*****", $connection);

mysql_query('Insert into ***** (username,password,email,gamename) values ("'.$user.'","'.$pass.'","'.$email.'","'.$charname.'")',$connection);

if (mysql_affected_rows() == 1){

echo "<h1><u><b>You are registered, please feel free to login</font></u></b></h1>";

}else{

echo "<h1><u><b>Username or character name already exists please use a diffrent username or character name</font></u></b></h1>";

 

I cannot spot any problems with the code but I have only been coding for about 1 month.

}

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.