MySQLi error when inserting
I have a problem. When I want to insert in mysql table from php it doesn't work and it write an error
Unknown column 'pass' in 'field list'
I tried delete and create entire table through php and it works.
When I try the same query in phpMyAdmin, it works.
My php is
$sql = "INSERT INTO users(login,name,surname,pass,city,street,email,cardnr,zip,phone) VALUES('".$login."','".$name."','".$surname."','".$pass."','".$city."','".$street."','".$mail."','".$card."','".$zip."','"开发者_JAVA技巧.$phone."')";
$this->link->query($sql);
Please help me, thanks and sorry for my english
you table users
doesn't contain a pass
column.
The error message is pretty self-explanatory, you should check your spelling of the column name.
Otherwise, are you sure you're working on the same database with PHPMyAdmin and your PHP code ?
try encapsulating all field names with ` (backtik)
精彩评论