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.

}

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.