Good morning, I'm trying to determine if a domain name is already present in the database. I was trying to use the function PHP: $client->domains_get_all_by_user($session_id, $sys_groupid); but I realized I have no clue how to retrieve the sys_groupip value. I looked up in the database, and I got these results: From what I see, the sys_groupid of the client is different from the sys_groupid of the domain, which I don't understand how works. Each time I create a domain it seems to use the groupid value inside the sys_group table - instead of the one provided by PHP: $client->client_get($session_id, array('username' => 'cl21g001'))[0]['sys_groupid']; My question is: how can I determine in an easy way if a domain is already present in the database or not? Thank you
Code: $domain = $client->sites_web_domain_get($session_id, array('domain' => 'mydomain.tld')); if you get an array back with the domain details, then the domain exists, otherwise, you get false.
The sys_groupid is the ID of the group that owns a record and each client has it's own group, see sys_group table. This works similar to the Linux user and group system. The client is not owned by itself, the owner of the client is either the admin or the reseller if it belongs to a reseller.
Btw, the function I posted above is about websites, if you want to query the domain list of the client module, use: Code: $domain = $client->domains_domain_get($session_id, array('domain' => 'mydomain.tld'));