[英]Codeignitor Error Number: 1066 "Not unique table/alias"
What I am trying to do我想做什么
$this->form_validation->set_rules('username', $this->lang->line('signup_username'), 'required|callback__usernameRegex|min_length[5]|max_length[15]|is_unique[users.username]',
array(
'required' => $this->lang->line('signup_username_missing'),
'is_unique' => $this->lang->line('signup_username_exists')
)
);
$this->form_validation->set_rules('email', $this->lang->line('signup_email'), 'required|valid_email|is_unique[users.email]',
array(
'required' => $this->lang->line('signup_email_missing'),
'is_unique' => $this->lang->line('signup_email_exists')
)
);
username and email should be unique as expected so I'm using is_unique[users.username]
and is_unique[users.email]
to check for it, but as soon as I run username 和 email 应该像预期的那样是唯一的,所以我使用
is_unique[users.username]
和is_unique[users.email]
来检查它,但是一旦我运行
$this->form_validation->run()
I am getting error 1066我收到错误 1066
Not unique table/alias: 'sdy_users'
不是唯一的表/别名:'sdy_users'
and query it returns is并查询它返回的是
SELECT * FROM
sdy_users
,sdy_users
WHEREusername
= 'testu' ANDSELECT * 来自
sdy_users
,sdy_users
WHEREusername
= 'testu' AND
it is somehow adding the table name twice!它以某种方式添加了两次表名! Earlier it was working but I am failing to understand what is wrong!
早些时候它正在工作,但我不明白出了什么问题!
there is a problem in your query please correct it您的查询有问题请更正
SELECT * FROM sdy_users, sdy_users WHERE username = 'testu' AND email = 'test@sd.net' LIMIT 1
why are you using this twice??你为什么要用这个两次?? sdy_users, sdy_users??
sdy_users, sdy_users?? because of this system showing this error Not unique table/alias: 'sdy_users'
由于此系统显示此错误 Not unique table/alias: 'sdy_users'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.