开发者

MySQLi error when inserting

开发者 https://www.devze.com 2023-02-16 00:48 出处:网络
I have a problem. When I want to insert in mysql table from php it doesn\'t work and it write an error

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消