function limit_rightholder($limit, $hostname) { //Haal de titles id if ($title_id = get_title_id($limit, $hostname)) { //Haal de naamen van de rechthebbende op waar id's in string $sql = "SELECT nameShort FROM rightholders WHERE uid in ( SELECT rightholder FROM titles WHERE uid IN (" . $title_id . ") )"; //Voer de query uit if ($qeury = mysql_query($sql)) { //Zet de namen van de rechthebbende in array while ($name = mysql_fetch_array($qeury)) { $rightholder_name[] = $name['nameShort']; } //Controller of de array niet leeg is if (!empty($rightholder_name)) { //Stuur de array terug return $rightholder_name; } else { return false; } } else { return false; } } else { return false; } }
function new_parent($title, $fullname, $email, $mobile) { global $connection; $hash = md5($fullname . date('Y-m-d H:i:s')); $title = get_title_id($title); $query = "INSERT INTO parents (hash, full_name, title) "; $query .= "VALUES ('{$hash}', '{$fullname}', {$title})"; $query_execute = mysql_query($query, $connection); if ($query_execute) { $query = "INSERT INTO contacts (belongsto, phone, email) VALUES("; $query .= "'{$hash}', '{$mobile}', '{$email}')"; $result = mysql_query($query); if ($result) { // echo "contacts insertion successfull"; } } else { return false; } return true; }