Ok , so i have this code . When i press submit , with , lets say , Bob , written in the Username box , it says "ErrorUnknown column ‘Bob’ in ‘field list’ " . I dont know what is wrong , and could use some help .Here is my PhPMyAdmin info :Apache/2.2.21 (Win64) PHP/5.3.8
MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
PHP extension: mysqli
Server: localhost (localhost via TCP/IP)
Server version: 5.5.16-log
Protocol version: 10
User: root@localhost
MySQL charset: UTF-8 Unicode (utf8)
phpMyAdmin
Version information: 3.4.5
As you can see , i have a basic login page , and an mysql page , to introduce the data .
Yes , i am a noob … I dont really know what to do . Anyway , thank you for your time .
[code]
registrationtLogin
Username
Password
Submit
if (isset($_GET['msg'])
{
$message=$_GET['msg'] ;
if ($message == "1")
echo Entry succesfully inserted! ;
}
?>
</td>
</tr>
</body>
<?php
$con = mysqli_connect ("localhost", "root", "","users")
or die("Failed to connect" .mysqli_connect_error()) ;
$username = mysqli_real_escape_string($con, $_POST [ 'username' ]) ;
$password = mysqli_real_escape_string($con, $_POST [ 'password' ]) ;
$query = "INSERT INTO login (username, password) values ($username, $password) " ;
if(!mysqli_query($con, $query))
{
echo "Error" .mysqli_error($con) ;
} else {
header("Location: registration.html?msg=1") ;
}
?>
[/code]