Check duplicate data in CodeIgniter try to make a callback function
By : M.Dogankaya
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Your problem is in the model function. Look at the following model function. code :
public function checkDuplicateEmail($post_email) {
$this->db->where('email_id', $email_id);
$query = $this->db->get('my_registration_table');
$count_row = $query->num_rows();
if ($count_row > 0) {
//if count row return any row; that means you have already this email address in the database. so you must set false in this sense.
return FALSE; // here I change TRUE to false.
} else {
// doesn't return any row means database doesn't have this email
return TRUE; // And here false to TRUE
}
}
|
How to re-populate check box in edit form using Codeigniter
By : lanthanum
Date : March 29 2020, 07:55 AM
|
Check duplicate data in CodeIgniter result
By : Alex
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Managed to get what I think you are trying to achieve by using a group by i.e. code :
SELECT * FROM posts GROUP BY forumId;
SELECT *
FROM (
SELECT *
FROM posts
ORDER BY date DESC
LIMIT 18446744073709551615
) AS sub
GROUP BY sub.forumId
ORDER BY id DESC
|
Codeigniter Edit (Check Duplicate + Allow to Update if duplicate not found)
By : neilyo_chc
Date : December 20 2020, 04:45 AM
Hope this helps For this problem you have to send user ID in which function you can check duplicate's of user name. code :
$this->userdb->UsernameDuplicatechecking($userName,$id);
$this->db->where("userId <> $id");
|
problem with duplicate values check in the edit page
By : Sankar Ganesh Arumug
Date : January 02 2021, 06:48 AM
To fix the issue you can do The problem is that your query becomes Select Email from Persona where Email='', which returns zero records, indicating that the empty email address is available, allowing your code to continue. You need to validate your user input. Use the RequiredFieldValidator, for example, see How to validate this data entry form in ASP.NET Web Forms? and Microsoft Docs: RequiredFieldValidator. This makes sure that your code isn't executed when the email textbox is empty. code :
SELECT Email FROM Persona WHERE Email = @Email AND Id != @Id
|