11 $this->render(
'index');
22 $subtopicname = mysql_query(
"SELECT * FROM interests_subtopics_confirmation WHERE id=$subtopicid");
24 while($row2= mysql_fetch_array($subtopicname))
26 $subname = $row2[
'name'];
27 $subtopic_name = $row2[
'name'];
28 $sql_insert_subtopic=
"INSERT IGNORE INTO interests_subtopics (name)
31 mysql_query($sql_insert_subtopic) or die (mysql_error());
33 $topics = mysql_query(
"SELECT * FROM interests_topics_confirmation WHERE id IN
34 (SELECT DISTINCT topicid FROM topic_subtopic_confirmation WHERE subtopicid=$subtopicid)");
37 while($row = mysql_fetch_array($topics))
39 $topic_name = $row[
'name'];
40 $topicid = $row[
'id'];
41 $topicexists = mysql_query(
"SELECT * FROM interests_topics WHERE name='$topic_name'");
43 if(mysql_num_rows($topicexists)!=0) {}
45 $sql_insert_topic=
"INSERT IGNORE INTO interests_topics ( name)
48 mysql_query($sql_insert_topic) or die (mysql_error());
58 $sql_edit_request=
"UPDATE topic_subtopic_confirmation SET accepted=1 WHERE topicid=$topicid AND subtopicid=$subtopicid";
59 mysql_query($sql_edit_request) or die (mysql_error());
61 $topid = mysql_query(
"SELECT * FROM interests_topics WHERE name='$topic_name'");
63 while($row3=mysql_fetch_array($topid))
65 $topicid = $row3[
'id'];
67 $subid = mysql_query(
"SELECT * FROM interests_subtopics WHERE name='$subtopic_name'");
69 while($row4=mysql_fetch_array($subid))
71 $subtopid = $row4[
'id'];
73 $sql_insert_topic_subtopic=
"INSERT INTO topic_subtopic (topicid, subtopicid)
75 ('$topicid', '$subtopid' )";
76 mysql_query($sql_insert_topic_subtopic) or die (mysql_error());
84 echo $subname .
"<br>" . $topic_name .
"<br><br><br>";
95 $subtopicname = mysql_query(
"SELECT * FROM interests_subtopics_confirmation WHERE id=$subtopicid");
97 while($row2= mysql_fetch_array($subtopicname))
99 $subname = $row2[
'name'];
100 $subtopic_name = $row2[
'name'];
101 $sql_insert_subtopic=
"INSERT IGNORE INTO interests_subtopics (name)
104 mysql_query($sql_insert_subtopic) or die (mysql_error());
106 $topics = mysql_query(
"SELECT * FROM interests_topics WHERE id IN
107 (SELECT DISTINCT topicid FROM topic_subtopic_existing_confirmation WHERE subtopicid=$subtopicid)");
110 while($row = mysql_fetch_array($topics))
112 $topic_name = $row[
'name'];
113 $topicid = $row[
'id'];
120 $sql_edit_request=
"UPDATE topic_subtopic_existing_confirmation SET accepted=1 WHERE topicid=$topicid AND subtopicid=$subtopicid";
121 mysql_query($sql_edit_request) or die (mysql_error());
123 $topid = mysql_query(
"SELECT * FROM interests_topics WHERE name='$topic_name'");
125 while($row3=mysql_fetch_array($topid))
127 $topicid = $row3[
'id'];
129 $subid = mysql_query(
"SELECT * FROM interests_subtopics WHERE name='$subtopic_name'");
131 while($row4=mysql_fetch_array($subid))
133 $subtopid = $row4[
'id'];
135 $sql_insert_topic_subtopic=
"INSERT INTO topic_subtopic (topicid, subtopicid)
137 ('$topicid', '$subtopid' )";
138 mysql_query($sql_insert_topic_subtopic) or die (mysql_error());
146 echo $subname .
"<br>" . $topic_name .
"<br><br><br>";