<?php

defined('BASEPATH') or exit('No direct script access allowed');

function getid_contact_by_user($ci,$email){
    $ci->db->select('id,userid'); // Select all columns
    $ci->db->from(db_prefix() . 'contacts'); // Specify the table name

    // Define your WHERE conditions
    $ci->db->where('email', $email);
    $ci->db->where('role', 'client');

    // Get the results
    $query = $ci->db->get();
    if($query->num_rows() > 0){
        return $query->row();
    }
}