Meno:
Meno: url ?>
id; $db_result = mysql_query($db_query); if (!$db_result) die ('Chyba SQL: ' . mysql_error() . " " .$db_query); else { $db_row = mysql_fetch_row($db_result); $this->id = $db_row[0]; $this->url = $db_row[1]; } } /* }}} */ public function data_insert() { /* {{{ ********************************/ db_connect(); $db_query = "INSERT INTO c_web (".($this->id > 0? "pk_c_web, " : "")."url ". ") VALUES (".($this->id > 0? "'" . $this->id . "', ": "")."'". $this->url . "')"; $db_result = mysql_query($db_query); if (!$db_result) die ('Chyba SQL: ' . mysql_error() . " " .$db_query); else $this->id = mysql_insert_id(); return true; } /* }}} */ public function data_update() { /* {{{ ********************************/ db_connect(); $db_query = "UPDATE c_web SET " . "url='". $this->url . "' ". "WHERE pk_c_web='". $this->id ."'"; if ($this->id > 0) $db_result = mysql_query($db_query); if (!$db_result) die ('Chyba SQL: ' . mysql_error() . " " .$db_query); return true; } /* }}} */ public function data_delete() { /* {{{ ********************************/ db_connect(); $db_query = "DELETE FROM c_join_person_web " . "WHERE " . "fk_c_web='". $this->id ."' AND ". "fk_c_person='". $_GET["id_person"] . "'"; $db_result = false; if ($this->id > 0) $db_result = mysql_query($db_query); if (!$db_result) die ('Chyba SQL: ' . mysql_error() . " " .$db_query); return true; } /* }}} */ } /* }}} */ function print_list_web($p_link) { /* {{{ ********************************/ db_connect(); $db_query = "SELECT ". "c_web.pk_c_web, ". "c_web.url, " . "c_person.pk_c_person, ". "c_person.name, ". "c_person.surname, ". "c_join_person_web.note, ". "c_company.pk_c_company, ". "c_company.name, ". "c_join_company_web.note ". "FROM ". "c_web ". "LEFT JOIN c_join_person_web ON pk_c_web=c_join_person_web.fk_c_web ". "LEFT JOIN c_person ON pk_c_person=fk_c_person ". "LEFT JOIN c_join_company_web ON pk_c_web=c_join_company_web.fk_c_web ". "LEFT JOIN c_company ON pk_c_company=fk_c_company ". "GROUP BY pk_c_web ". "ORDER BY c_web.url"; $db_result = mysql_query($db_query); if (!$db_result) die (MSG_ERROR_SQL . mysql_error() . " " . $db_query); else if (mysql_num_rows($db_result)>0) { ?>