$query = "INSERT INTO `userregistration` (Username,Password,Email,Country,IP,Gender) Values ('$Username', '$Password', '$Email', '$Country', '$ip', '$Gender')";
mysql_query($query) or die(mysql_error());
Also the $ip = $_SERVER["REMOTE_ADDR"]; when i test this, in the database the result comes out as "Array" instead of an IP number :S? Im not entirely sure why this is.. any thoughts?
Ok i would paste the error but its behind my main site so i can't paste it neatly.
But it says:
Notice: Trying to get property of non-object in C:\xampp\htdocs\RegisterPage.php on line 1
repeated x 31
Notice: Trying to get property of non-object in C:\xampp\htdocs\RegisterPage.php on line 32
INSERT INTO `userregistration` (Username,Password,Email,Country,IP,Gender) Values ('', '', '', '', '127.0.0.1', 'Male')
I deffinatly inputted something into the fields but only IP and gender actually appears in the database table.
I checked for case sensitivity on the field names its deffinatly a match so i duno why it wont input.
SirChick wrote:I checked for case sensitivity on the field names its deffinatly a match so i duno why it wont input.
Because regardless of how right you think it is, it's wrong. print_r($_POST).
Also, we can't help you with the other errors if you don't post that code up as well.
And on a different note, why is that you escape some posted data, but not all?
There are a couple of things that would bother me if i were reviewing the code...
- Variable naming: what does '$jump2' represent?
- Using data that might not exists: $Username = mysql_real_escape_string($_POST['Username']);
- Using data that is not prepared for use in a query: $chkUSERNAME = mysql_query("SELECT * FROM `userregistration` WHERE `Username` = '".$_POST['Username']."'");
- Odd logic: You simply want to select a count of the rows where the username or e-mail equal something that already exists...