Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
执行php脚本时,“where子句”中的未知列“asdf”_Php_Mysql - Fatal编程技术网

执行php脚本时,“where子句”中的未知列“asdf”

执行php脚本时,“where子句”中的未知列“asdf”,php,mysql,Php,Mysql,我是编程的初学者。 我无法解决以下错误。authentication_credentials表包含一个名为“id”的列。 “asdf”是我在浏览器页面中提供的用户名。 这导致了以下错误: Unknown column 'asdf' in 'where clause' 在执行php脚本时 请帮忙 $uname = $_POST['uname']; $query_request = "SELECT password FROM authentication_credentials WHERE i

我是编程的初学者。 我无法解决以下错误。authentication_credentials表包含一个名为“id”的列。 “asdf”是我在浏览器页面中提供的用户名。 这导致了以下错误:

Unknown column 'asdf' in 'where clause' 
在执行php脚本时

请帮忙

$uname  = $_POST['uname'];
$query_request = "SELECT password FROM authentication_credentials WHERE id=$uname";
$query_result = mysql_query($query_request) or die(mysql_error());
我假设$uname是一个字符串,而您的查询是错误的$name必须在单个quete中

将该查询更改为此

$query_request = "SELECT password FROM authentication_credentials WHERE id='$uname'";
检查sql标识符的名称


还有一件事mysqli_uu不能神奇地保护您的代码。记住这一点

一个可能的原因是在表身份验证上有一个触发器。\u credentials.mysql错误检查表、列和连接是否正确,因为它是一个字符串,所以必须将它括在引号中。