CVE-2015-10050: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (CWE-89)
value: A vulnerability was found in brandonfire miRNA_Database_by_PHP_MySql. It has been declared as critical. This vulnerability affects the function __construct/select_single_rna/count_rna of the file inc/model.php. The manipulation leads to sql injection. The patch is identified as 307c5d510841e6142ddcbbdbb93d0e8a0dc3fd6a. It is recommended to apply a patch to fix this issue. VDB-218374 is the identifier assigned to this vulnerability.
CWE description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
CVSS v3 base score: 9.8
Published: 2023-01-15T18:15Z
Repository: https://github.com/brandonfire/miRNA_Database_by_PHP_MySql
Language: PHP
Files changed: .gitignore, README.md, css/main.css, css/normalize.css, css/response.css, css/style.css, img/result.php, inc/config.php, inc/footer.php, inc/header.php, inc/mirnatable.html.php, inc/model.php, inc/pagenation.html.php, index.php, main.css, mirna.php, result.php
Commit date: 2015-01-23 11:34:02 -0500
Commit message: prevent sql injection

Diff: diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..af79590
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+php_errorlog
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3c8b730
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+# miRNA_Database_by_PHP_MySql
+Hi, Welecome to my first version of PHP/MySql database management Web application.
+
+The inc/model.php contains rna_database class code of database management.
+
+for web access, please visit 
+'<a href = "http://www.cbhuatusf.com/MRCD/"> MRCD database</a>';
+Thank you.
diff --git a/css/main.css b/css/main.css
new file mode 100644
index 0000000..d04edf1
--- /dev/null
+++ b/css/main.css
@@ -0,0 +1,296 @@
+
+a {
+  text-decoration: none;
+}
+
+body {
+  font-family: 'Open Sans', sans-serif;
+}
+
+
+#wrapper {
+  max-width: 940px;
+  margin: 0 auto;
+  padding:0 5%;
+}
+
+#logo {
+  text-align: center;
+  margin: 0; 
+
+}
+/* link color */
+a {
+  color:#6ab47b;
+}
+
+img {
+  max-width: 100%
+}
+
+/* green header*/
+header {
+  padding: 10px 0 0 0;
+  background: #6ab47b;
+  border-color:#599a68;
+}
+header {
+	float: left;
+	margin: 0 0 30px 0;
+	padding: 5px 0 0 0;
+	width: 100%;
+}
+h1, h2 {
+  color:#fff;
+}
+
+h1 {
+  font-family: 'Changa One', sans-serif;
+  margin: 5px 0;
+  font-size: 1.5em;
+  font-weight: normal;
+  line-height: 1.8em;/* for paragarph space*/
+}
+
+h2 {
+  font-family: 'Lato', sans-serif;
+  font-size: 1.25em; 
+  margin: 5px 0 0;
+  font-weight: normal;
+}
+
+nav {
+  text-align: center;
+  padding: 0px 30px 0px 0;
+  margin: 20px 0 0;
+}
+
+footer{
+  font-size: 0.74em;
+  text-align: center;
+  clear: both;
+  padding-top: 50px;
+  color: #555;
+}
+.social {
+	width:20px;
+	height:20px;
+	margin:0 5px;
+}
+
+#ga {
+  margin:0;
+  padding: 0;
+  list-style:none;
+}
+
+#ga li {
+  float: left;
+  width:45%;
+  margin:2.5%;
+  background-color:#f5f5f5;
+  color: #bdc3c7;
+  
+}
+
+#ga li a p {
+  margin: 0;
+  padding:5%;
+  font-size:0.75em;
+  color: #000000;
+}
+
+
+h1:hover, h2:hover {
+  color:#32623f;
+}
+
+/* nav background for mobile */
+nav {
+  background:#599a68;
+}
+
+nav a, nav a:visited {
+  color:#fff;
+}
+
+nav a.ss, nav a:hover {
+  color:#32623f;
+}
+nav {
+	text-align: center;
+	padding: 10px 0;
+	margin: 20px 0 0;
+
+}
+
+nav ul {
+	list-style:none;
+	margin:0 10px;
+	padding:0;
+}
+nav li {
+	display: inline-block;
+}
+
+nav a {
+	font-weight:800;
+	padding: 15px 10px;
+}
+
+body { /* site body */
+  background-color:#fff;
+  color:#888;
+}
+/* PAGE: About */
+.profile-photo {
+	display: block;  /*use block could enable auto to center element image default inline*/
+	max-width: 150px;
+	margin: 0 auto 30px; /*margin 3 numbers: top, leftright, bottom*/
+	border-radius: 100%
+
+}
+h3 {
+	margin:0 0 1em 0;
+}
+/* PAGE: contact */
+.contact-info {
+	list-style: none;
+	padding: 0;
+	margin: 0;
+	font-size: 0.9em;
+}
+.contact-info a {
+	display: block;
+	min-height:20px;
+	background-repeat: no-repeat;
+	background-size: 20px 20px;
+	padding:0 0 0 30px;
+	margin: 0 0 10px;
+}
+
+.contact-info li.phone a {
+	background-image: url('../img/phone.png');
+}
+.contact-info li.mail a {
+	background-image: url('../img/mail.png');
+}
+.mirna {
+	color: #000;
+	display: block;
+	text-align: left;
+
+}
+.mirnalist {
+	color:darkgreen;
+	text-align: left;
+	float: left;
+	text-decoration:underline;
+}
+
+element.style {
+text-align: left;
+vertical-align: top;
+}
+.table-stats.table-bordered {
+
+}
+.table-stats {
+border: 1px solid #C2C2C2;
+border-collapse: separate;
+-webkit-border-radius: 0;
+-moz-border-radius: 0;
+border-radius: 0 !important;
+font-family: verdana,helvetica,arial,sans-serif;
+font-size: 11px;
+color: #333;
+}
+.table-bordered {
+border: 1px solid #dddddd;
+
+border-collapse: separate;
+-webkit-border-radius: 4px;
+-moz-border-radius: 4px;
+border-radius: 4px;
+}
+.table {
+width: 100%;
+margin-bottom: 18px;
+}
+
+
+td {
+text-align: left;
+vertical-align: top;
+}
+
+
+
+table {
+display: table;
+border-collapse: separate;
+border-spacing: 2px;
+border-color: gray;
+}
+table {
+max-width: 100%;
+border-collapse: collapse;
+border-spacing: 0;
+background-color: transparent;
+}
+table
+{
+text-align: center;
+background: #EEEEEE;
+margin-right: auto;
+margin-left: auto;
+}
+table {
+display: table;
+border-collapse: separate;
+border-spacing: 2px;
+border-color: gray;
+}
+table {
+max-width: 100%;
+border-collapse: collapse;
+border-spacing: 0;
+background-color: transparent;
+}
+
+table {
+display: table;
+border-collapse: separate;
+border-spacing: 2px;
+border-color: gray;
+}
+
+table {
+border-spacing: 4px;
+}
+table {
+max-width: 100%;
+border-collapse: collapse;
+border-spacing: 0;
+background-color: transparent;
+}
+.pagination {
+text-align: right;
+margin: 1em 0;
+}
+div {
+display: block;
+}
+.pagination span {
+background: #CCC;
+border-color: #999;
+color: #444;
+}
+.pagination a, .pagination span {
+padding: 0px 5px;
+border: 1px solid #e3e1e0;
+display: inline-block;
+text-decoration: none;
+color: #676767;
+}
+
diff --git a/css/normalize.css b/css/normalize.css
new file mode 100644
index 0000000..2ad2e0e
--- /dev/null
+++ b/css/normalize.css
@@ -0,0 +1,527 @@
+/*! normalize.css v1.1.0 | MIT License | git.io/normalize */
+
+/* ==========================================================================
+   HTML5 display definitions
+   ========================================================================== */
+
+/**
+ * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+    display: block;
+}
+
+/**
+ * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
+ */
+
+audio,
+canvas,
+video {
+    display: inline-block;
+    *display: inline;
+    *zoom: 1;
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+    display: none;
+    height: 0;
+}
+
+/**
+ * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
+ * Known issue: no IE 6 support.
+ */
+
+[hidden] {
+    display: none;
+}
+
+/* ==========================================================================
+   Base
+   ========================================================================== */
+
+/**
+ * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
+ *    `em` units.
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
+ *    user zoom.
+ */
+
+html {
+    font-size: 100%; /* 1 */
+    -webkit-text-size-adjust: 100%; /* 2 */
+    -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Address `font-family` inconsistency between `textarea` and other form
+ * elements.
+ */
+
+html,
+button,
+input,
+select,
+textarea {
+    font-family: sans-serif;
+}
+
+/**
+ * Address margins handled incorrectly in IE 6/7.
+ */
+
+body {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Links
+   ========================================================================== */
+
+/**
+ * Address `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+    outline: thin dotted;
+}
+
+/**
+ * Improve readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+    outline: 0;
+}
+
+/* ==========================================================================
+   Typography
+   ========================================================================== */
+
+/**
+ * Address font sizes and margins set differently in IE 6/7.
+ * Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
+ * and Chrome.
+ */
+
+h1 {
+    font-size: 2em;
+    margin: 0.67em 0;
+}
+
+h2 {
+    font-size: 1.5em;
+    margin: 0.83em 0;
+}
+
+h3 {
+    font-size: 1.17em;
+    margin: 1em 0;
+}
+
+h4 {
+    font-size: 1em;
+    margin: 1.33em 0;
+}
+
+h5 {
+    font-size: 0.83em;
+    margin: 1.67em 0;
+}
+
+h6 {
+    font-size: 0.67em;
+    margin: 2.33em 0;
+}
+
+/**
+ * Address styling not present in IE 7/8/9, Safari 5, and Chrome.
+ */
+
+abbr[title] {
+    border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
+ */
+
+b,
+strong {
+    font-weight: bold;
+}
+
+blockquote {
+    margin: 1em 40px;
+}
+
+/**
+ * Address styling not present in Safari 5 and Chrome.
+ */
+
+dfn {
+    font-style: italic;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ * Known issue: no IE 6/7 normalization.
+ */
+
+hr {
+    -moz-box-sizing: content-box;
+    box-sizing: content-box;
+    height: 0;
+}
+
+/**
+ * Address styling not present in IE 6/7/8/9.
+ */
+
+mark {
+    background: #ff0;
+    color: #000;
+}
+
+/**
+ * Address margins set differently in IE 6/7.
+ */
+
+p,
+pre {
+    margin: 1em 0;
+}
+
+/**
+ * Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
+ */
+
+code,
+kbd,
+pre,
+samp {
+    font-family: monospace, serif;
+    _font-family: 'courier new', monospace;
+    font-size: 1em;
+}
+
+/**
+ * Improve readability of pre-formatted text in all browsers.
+ */
+
+pre {
+    white-space: pre;
+    white-space: pre-wrap;
+    word-wrap: break-word;
+}
+
+/**
+ * Address CSS quotes not supported in IE 6/7.
+ */
+
+q {
+    quotes: none;
+}
+
+/**
+ * Address `quotes` property not supported in Safari 4.
+ */
+
+q:before,
+q:after {
+    content: '';
+    content: none;
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+    font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+    font-size: 75%;
+    line-height: 0;
+    position: relative;
+    vertical-align: baseline;
+}
+
+sup {
+    top: -0.5em;
+}
+
+sub {
+    bottom: -0.25em;
+}
+
+/* ==========================================================================
+   Lists
+   ========================================================================== */
+
+/**
+ * Address margins set differently in IE 6/7.
+ */
+
+dl,
+menu,
+ol,
+ul {
+    margin: 1em 0;
+}
+
+dd {
+    margin: 0 0 0 40px;
+}
+
+/**
+ * Address paddings set differently in IE 6/7.
+ */
+
+menu,
+ol,
+ul {
+    padding: 0 0 0 40px;
+}
+
+/**
+ * Correct list images handled incorrectly in IE 7.
+ */
+
+nav ul,
+nav ol {
+    list-style: none;
+    list-style-image: none;
+}
+
+/* ==========================================================================
+   Embedded content
+   ========================================================================== */
+
+/**
+ * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
+ * 2. Improve image quality when scaled in IE 7.
+ */
+
+img {
+    border: 0; /* 1 */
+    -ms-interpolation-mode: bicubic; /* 2 */
+}
+
+/**
+ * Correct overflow displayed oddly in IE 9.
+ */
+
+svg:not(:root) {
+    overflow: hidden;
+}
+
+/* ==========================================================================
+   Figures
+   ========================================================================== */
+
+/**
+ * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
+ */
+
+figure {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Forms
+   ========================================================================== */
+
+/**
+ * Correct margin displayed oddly in IE 6/7.
+ */
+
+form {
+    margin: 0;
+}
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+    border: 1px solid #c0c0c0;
+    margin: 0 2px;
+    padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct color not being inherited in IE 6/7/8/9.
+ * 2. Correct text not wrapping in Firefox 3.
+ * 3. Correct alignment displayed oddly in IE 6/7.
+ */
+
+legend {
+    border: 0; /* 1 */
+    padding: 0;
+    white-space: normal; /* 2 */
+    *margin-left: -7px; /* 3 */
+}
+
+/**
+ * 1. Correct font size not being inherited in all browsers.
+ * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
+ *    and Chrome.
+ * 3. Improve appearance and consistency in all browsers.
+ */
+
+button,
+input,
+select,
+textarea {
+    font-size: 100%; /* 1 */
+    margin: 0; /* 2 */
+    vertical-align: baseline; /* 3 */
+    *vertical-align: middle; /* 3 */
+}
+
+/**
+ * Address Firefox 3+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+button,
+input {
+    line-height: normal;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
+ * Correct `select` style inheritance in Firefox 4+ and Opera.
+ */
+
+button,
+select {
+    text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ *    and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ *    `input` and others.
+ * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
+ *    Known issue: inner spacing remains in IE 6.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+    -webkit-appearance: button; /* 2 */
+    cursor: pointer; /* 3 */
+    *overflow: visible;  /* 4 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+    cursor: default;
+}
+
+/**
+ * 1. Address box sizing set to content-box in IE 8/9.
+ * 2. Remove excess padding in IE 8/9.
+ * 3. Remove excess padding in IE 7.
+ *    Known issue: excess padding remains in IE 6.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+    box-sizing: border-box; /* 1 */
+    padding: 0; /* 2 */
+    *height: 13px; /* 3 */
+    *width: 13px; /* 3 */
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
+ *    (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+    -webkit-appearance: textfield; /* 1 */
+    -moz-box-sizing: content-box;
+    -webkit-box-sizing: content-box; /* 2 */
+    box-sizing: content-box;
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari 5 and Chrome
+ * on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+    -webkit-appearance: none;
+}
+
+/**
+ * Remove inner padding and border in Firefox 3+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+    border: 0;
+    padding: 0;
+}
+
+/**
+ * 1. Remove default vertical scrollbar in IE 6/7/8/9.
+ * 2. Improve readability and alignment in all browsers.
+ */
+
+textarea {
+    overflow: auto; /* 1 */
+    vertical-align: top; /* 2 */
+}
+
+/* ==========================================================================
+   Tables
+   ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
\ No newline at end of file
diff --git a/css/response.css b/css/response.css
new file mode 100644
index 0000000..1209ec1
--- /dev/null
+++ b/css/response.css
@@ -0,0 +1,68 @@
+@media screen and (min-width: 480px) {
+  /*********
+  Two Column Layout
+  ********/
+  #primary{
+    width: 35%;
+    float: left;
+    margin: 0 0 0 15%;  
+  }
+  
+  #secondary {
+    width: 40%;
+    float: right;
+  }
+ /*********
+  PAGE:Portfolio
+  ********/
+/*  #ga li{
+    width:28.3333%;
+  }
+  #gi li:nth-child(4n){
+    clear: left;
+  }*/
+}
+
+@media screen and (min-width: 660px) {
+ /*********
+  PAGE:About
+  ********/
+  .profile-photo {
+    float: left;
+    margin: 0 15% 80px 0;
+  }
+ /*********
+  Header
+  ********/
+  nav {
+  background: none;
+  float: right;
+  font-size: 1.125em;
+  margin-right: 5%;
+  text-align: right;
+  width: 45%;
+  }
+  #logo {
+    float: left;
+    margin-left: 5%;
+    text-align: left;
+    width: 45%;
+  }
+  h1{
+    font-size: 1.5em;
+  }
+  h2 {
+    font-size: 0.825em;
+    margin-bottom: 20px;
+  }
+  header {
+    border-bottom: 5px solid #599a68;
+    margin-bottom:60px;
+  }
+}
+
+
+
+
+
+
diff --git a/css/style.css b/css/style.css
new file mode 100644
index 0000000..c44cd05
--- /dev/null
+++ b/css/style.css
@@ -0,0 +1,742 @@
+/*! normalize.css - http://github.com/necolas/normalize.css */
+
+/* ==========================================================================
+   HTML5 display definitions
+   ========================================================================== */
+
+/*
+ * Corrects `block` display not defined in IE6/7/8/9 & FF3.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section,
+summary {
+    display: block;
+}
+
+/*
+ * Corrects `inline-block` display not defined in IE6/7/8/9 & FF3.
+ */
+
+audio,
+canvas,
+video {
+    display: inline-block;
+    *display: inline;
+    *zoom: 1;
+}
+
+/*
+ * Prevents modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS5 devices.
+ */
+
+audio:not([controls]) {
+    display: none;
+    height: 0;
+}
+
+/*
+ * Addresses styling for `hidden` attribute not present in IE7/8/9, FF3, S4.
+ * Known issue: no IE6 support.
+ */
+
+[hidden] {
+    display: none;
+}
+
+/* ==========================================================================
+   Base
+   ========================================================================== */
+
+/*
+ * 1. Corrects text resizing oddly in IE6/7 when body `font-size` is set using
+ *    `em` units.
+ * 2. Prevents iOS text size adjust after orientation change, without disabling
+ *    user zoom.
+ */
+
+html {
+    font-size: 100%; /* 1 */
+    -webkit-text-size-adjust: 100%; /* 2 */
+    -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/*
+ * Addresses `font-family` inconsistency between `textarea` and other form
+ * elements.
+ */
+
+html,
+button,
+input,
+select,
+textarea {
+    font-family: sans-serif;
+}
+
+/*
+ * Addresses margins handled incorrectly in IE6/7.
+ */
+
+body {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Links
+   ========================================================================== */
+
+/*
+ * Addresses `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+    outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers.
+ * people.opera.com/patrickl/experiments/keyboard/test
+ */
+
+a:active,
+a:hover {
+    outline: 0;
+}
+
+/* ==========================================================================
+   Typography
+   ========================================================================== */
+
+/*
+ * Addresses font sizes and margins set differently in IE6/7.
+ * Addresses font sizes within `section` and `article` in FF4+, Chrome, S5.
+ */
+
+h1 {
+    font-size: 2em;
+    margin: 0.67em 0;
+}
+
+h2 {
+    font-size: 1.5em;
+    margin: 0.83em 0;
+}
+
+h3 {
+    font-size: 1.17em;
+    margin: 1em 0;
+}
+
+h4 {
+    font-size: 1em;
+    margin: 1.33em 0;
+}
+
+h5 {
+    font-size: 0.83em;
+    margin: 1.67em 0;
+}
+
+h6 {
+    font-size: 0.75em;
+    margin: 2.33em 0;
+}
+
+/*
+ * Addresses styling not present in IE7/8/9, S5, Chrome.
+ */
+
+abbr[title] {
+    border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to `bolder` in FF3+, S4/5, Chrome.
+ */
+
+b,
+strong {
+    font-weight: bold;
+}
+
+blockquote {
+    margin: 1em 40px;
+}
+
+/*
+ * Addresses styling not present in S5, Chrome.
+ */
+
+dfn {
+    font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE6/7/8/9.
+ */
+
+mark {
+    background: #ff0;
+    color: #000;
+}
+
+/*
+ * Addresses margins set differently in IE6/7.
+ */
+
+p,
+pre {
+    margin: 1em 0;
+}
+
+/*
+ * Corrects font family set oddly in IE6, S4/5, Chrome.
+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59
+ */
+
+code,
+kbd,
+pre,
+samp {
+    font-family: monospace, serif;
+    _font-family: 'courier new', monospace;
+    font-size: 1em;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers.
+ */
+
+pre {
+    white-space: pre;
+    white-space: pre-wrap;
+    word-wrap: break-word;
+}
+
+/*
+ * Addresses CSS quotes not supported in IE6/7.
+ */
+
+q {
+    quotes: none;
+}
+
+/*
+ * Addresses `quotes` property not supported in S4.
+ */
+
+q:before,
+q:after {
+    content: '';
+    content: none;
+}
+
+small {
+    font-size: 75%;
+}
+
+/*
+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.
+ * gist.github.com/413930
+ */
+
+sub,
+sup {
+    font-size: 75%;
+    line-height: 0;
+    position: relative;
+    vertical-align: baseline;
+}
+
+sup {
+    top: -0.5em;
+}
+
+sub {
+    bottom: -0.25em;
+}
+
+/* ==========================================================================
+   Lists
+   ========================================================================== */
+
+/*
+ * Addresses margins set differently in IE6/7.
+ */
+
+dl,
+menu,
+ol,
+ul {
+    margin: 1em 0;
+}
+
+dd {
+    margin: 0 0 0 40px;
+}
+
+/*
+ * Addresses paddings set differently in IE6/7.
+ */
+
+menu,
+ol,
+ul {
+    padding: 0 0 0 40px;
+}
+
+/*
+ * Corrects list images handled incorrectly in IE7.
+ */
+
+nav ul,
+nav ol {
+    list-style: none;
+    list-style-image: none;
+}
+
+/* ==========================================================================
+   Embedded content
+   ========================================================================== */
+
+/*
+ * 1. Removes border when inside `a` element in IE6/7/8/9, FF3.
+ * 2. Improves image quality when scaled in IE7.
+ *    code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
+ */
+
+img {
+    border: 0; /* 1 */
+    -ms-interpolation-mode: bicubic; /* 2 */
+}
+
+/*
+ * Corrects overflow displayed oddly in IE9.
+ */
+
+svg:not(:root) {
+    overflow: hidden;
+}
+
+/* ==========================================================================
+   Figures
+   ========================================================================== */
+
+/*
+ * Addresses margin not present in IE6/7/8/9, S5, O11.
+ */
+
+figure {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Forms
+   ========================================================================== */
+
+/*
+ * Corrects margin displayed oddly in IE6/7.
+ */
+
+form {
+    margin: 0;
+}
+
+/*
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+    border: 1px solid #c0c0c0;
+    margin: 0 2px;
+    padding: 0.35em 0.625em 0.75em;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE6/7/8/9.
+ * 2. Corrects text not wrapping in FF3.
+ * 3. Corrects alignment displayed oddly in IE6/7.
+ */
+
+legend {
+    border: 0; /* 1 */
+    padding: 0;
+    white-space: normal; /* 2 */
+    *margin-left: -7px; /* 3 */
+}
+
+/*
+ * 1. Corrects font size not being inherited in all browsers.
+ * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome.
+ * 3. Improves appearance and consistency in all browsers.
+ */
+
+button,
+input,
+select,
+textarea {
+    font-size: 100%; /* 1 */
+    margin: 0; /* 2 */
+    vertical-align: baseline; /* 3 */
+    *vertical-align: middle; /* 3 */
+}
+
+/*
+ * Addresses FF3/4 setting `line-height` on `input` using `!important` in the
+ * UA stylesheet.
+ */
+
+button,
+input {
+    line-height: normal;
+}
+
+/*
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ *    and `video` controls.
+ * 2. Corrects inability to style clickable `input` types in iOS.
+ * 3. Improves usability and consistency of cursor style between image-type
+ *    `input` and others.
+ * 4. Removes inner spacing in IE7 without affecting normal text inputs.
+ *    Known issue: inner spacing remains in IE6.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+    -webkit-appearance: button; /* 2 */
+    cursor: pointer; /* 3 */
+    *overflow: visible;  /* 4 */
+}
+
+/*
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+input[disabled] {
+    cursor: default;
+}
+
+/*
+ * 1. Addresses box sizing set to content-box in IE8/9.
+ * 2. Removes excess padding in IE8/9.
+ * 3. Removes excess padding in IE7.
+ *    Known issue: excess padding remains in IE6.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+    box-sizing: border-box; /* 1 */
+    padding: 0; /* 2 */
+    *height: 13px; /* 3 */
+    *width: 13px; /* 3 */
+}
+
+/*
+ * 1. Addresses `appearance` set to `searchfield` in S5, Chrome.
+ * 2. Addresses `box-sizing` set to `border-box` in S5, Chrome (include `-moz`
+ *    to future-proof).
+ */
+
+input[type="search"] {
+    -webkit-appearance: textfield; /* 1 */
+    -moz-box-sizing: content-box;
+    -webkit-box-sizing: content-box; /* 2 */
+    box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding and search cancel button in S5, Chrome on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+    -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in FF3+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+    border: 0;
+    padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE6/7/8/9.
+ * 2. Improves readability and alignment in all browsers.
+ */
+
+textarea {
+    overflow: auto; /* 1 */
+    vertical-align: top; /* 2 */
+}
+
+/* ==========================================================================
+   Tables
+   ========================================================================== */
+
+/*
+ * Remove most spacing between table cells.
+ */
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
+
+
+html {overflow-y: scroll; overflow-x: hidden;}
+body {font-family: 'Oswald', sans-serif; background:#f0eeed; color: #676767;}
+
+.wrapper {width: 980px; margin: 0 auto;}
+.header:after {content:"";height:0;display:block;visibility:hidden;clear:both;}
+.header {background: #ff8400; border-bottom: 5px solid #f16702;}
+.header .branding-title {float: left; margin: 0 0 0 12px; font: 0/0 serif; text-shadow: none; color: transparent; width:122px;height:77px;background:url(../img/branding-title.png) 0 14px no-repeat;padding: 14px 0;}
+.header .branding-title a {display: block; height: 77px; width: 122px;}
+.header .nav {float: right; top: 0; right: 0; margin: 0; position: relative; left: 15px; z-index: 99999999;}
+.header .nav li {display: inline-block; margin: 0; list-style: none;}
+.header .nav li.cart {margin-left: 64px; border: 0 solid #f16702; border-width: 0 8px;}
+.header .nav li a {
+    color: white;
+    text-decoration: none;
+    display: block;
+    line-height: 95px;
+    padding: 10px 0 0;
+    margin: 0 0 0 50px;
+    width: 90px;
+    text-align: right;
+    background: url('../img/nav-sprite.png') no-repeat 0px 105px;
+    text-transform: uppercase;
+    white-space: nowrap; 
+}
+.header .nav li.on a {text-decoration: underline;}
+.header .nav li a:hover, .header .nav li a:active {color: #FFE200;}
+.header .nav li.shirts a {background-position: 0px 0px;}
+.header .nav li.contact a {background-position: 0px -105px;}
+.header .nav li.cart a {
+    width: 122px;
+    font-size: 0/95px serif;
+    text-shadow: none;
+    color: transparent;
+    background-position: 16px -216px;
+    margin: 0;
+}
+.header .nav li.cart a:hover {background-position: 16px -321px;}
+#content {min-height: 400px; background: white;}
+.section.banner {height: 290px; background: #3d3d3d url('../img/banner-background.jpg') center center no-repeat;}
+.section.banner .wrapper {position: relative;}
+.section.banner .hero {position: absolute; top: -89px; left: 177px; z-index: 999;}
+.section.banner .button {
+    display: block;
+    position: absolute;
+    top: 97px;
+    left: 590px;
+    margin: 0;
+    background-image: linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
+    background-image: -o-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
+    background-image: -moz-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
+    background-image: -webkit-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
+    background-image: -ms-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
+    background-image: -webkit-gradient(
+        linear,
+        left bottom,
+        left top,
+        color-stop(0, rgb(35,124,219)),
+        color-stop(0.16, rgb(39,136,232)),
+        color-stop(1, rgb(119,184,249))
+    );
+    -webkit-border-radius: 10px;
+    border-radius: 10px;
+    border: 5px solid #029af1;
+    z-index: 0;
+}
+.section.banner a {
+    width: 200px;
+    padding: 20px 20px 20px 50px;
+    display: block;
+    text-decoration: none;
+    background: url(../img/banner-link-arrow.png) 100% 50% no-repeat;
+    color: #FFF;
+}
+.section.banner a:hover {
+    color: #ffe200;
+}
+.section.banner h2 {
+    font-size: 18px;
+    font-weight: normal;
+    margin: 0;
+    line-height: 1.3;
+}
+.section.banner p {
+    color: #ffe200;
+    font-style: italic;
+    font-size: 14px;
+    margin: 0;
+}
+.section.page:after {content:"";display:block;visibility:hidden;height:0;clear:both;}
+.section.page {padding: 34px 0; background: white;}
+.section.page h1 {
+    font-size: 24px; 
+    text-align: center;
+    text-transform: uppercase;
+    line-height: 1.6;
+    font-weight: normal;    
+}
+.section.page .shirt-details h1 {
+    text-align: left;
+}
+.section.page p {width: 375px; margin-left: auto; margin-right: auto; }
+.section.page .shirt-details h1 .price {color: #9d9f4e; padding-right: 10px; font-size: 34px;}
+.section.shirts {padding-bottom: 42px; background: #fff;}
+.section.shirts h2 {
+    font-size: 24px; 
+    color: #c0bfbe;
+    text-align: center;
+    text-transform: uppercase;
+    line-height: 1.6;
+    font-weight: normal;
+}
+.section.shirts ul.products {margin: 0 0 -17px 0; padding: 0; width: 997px;}
+.section.shirts ul.products li {
+    display: inline-block;
+    list-style: none;
+    border: 1px solid #e3e1e0;
+    -webkit-border-radius: 2px;
+    border-radius: 2px;
+    width: 202px;
+    text-align: center;
+    text-transform: lowercase;
+    padding: 14px;
+    background: #f0eeed;
+    margin: 0 0 17px 17px;
+    position: relative;
+    left: -17px;
+}
+.section.shirts ul.products li a:hover:after {
+    content: '+';
+    font-size: 50px; position: absolute; top: -10px; right: 25px; color: #f16702; vertical-align: top;    
+}
+.section.shirts ul.products li a {
+    background: white;
+    display: block;
+    padding: 30px 0 10px;
+    text-decoration: none;
+    color: #999;
+    opacity: .9;
+}
+.section.shirts ul.products li a:hover {
+    opacity: 1;
+    color: #666;
+}
+.section.shirts ul.products li img {
+    width: 190px;
+}
+.section.shirts ul.products li p {
+    margin-left: 0;
+    margin-right: 0;
+    width: auto;
+}
+
+.shirt-picture {
+    float: left;
+    width: 460px;
+    text-align: center;
+    border: 1px solid #d9d9d9;
+    padding: 14px;
+    background: #f0eeed;    
+}
+.shirt-picture span {
+    background: white;
+    display: block;
+    width: 100%;
+    padding: 36px 0 61px;
+}
+.shirt-picture img {width: 292px;}
+.shirt-details {
+    width: 460px;
+    float: right;
+}
+.shirt-details form {
+    margin-left: 0;
+}
+form {width: 375px; margin: 34px auto;}
+form tr {
+    border: 1px solid #CCC;
+    background: #f4f3f2;
+}
+form table {width: 375px; margin-bottom: 16px;}
+form th {
+    width: 85px;
+    border-right: 1px solid #CCC;
+    vertical-align: middle;
+    padding: 8px;
+}
+form td {
+    padding: 15px 15px;
+}
+form td select,
+form td input,
+form td textarea {
+    width: 100%;
+}
+form input[type="submit"] {
+    width: 375px;
+    text-align: center;
+    border: 1px solid #8e8e46;
+    background: #9c9f4e;
+    color: #FFF;
+    -webkit-border-radius: 2px;
+    border-radius: 2px;    
+    font-size: 14px;
+    text-transform: uppercase;
+    padding: 14px;
+}
+.breadcrumb {
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 14px;
+    font-weight: normal;
+    padding: 14px 0 48px;
+}
+.note-designer {
+    font-family: Georgia, serif;
+    font-size: 14px;
+    font-style: italic;
+    font-weight: bold;
+}
+
+.footer {
+    background: #f0eeed;
+    padding: 42px 0;
+    font-size: 12px;
+    color: #a5a5a5;
+    font-family: Helvetica, Arial, sans-serif;
+}
+.footer ul {margin: 0; padding: 0; float: left;}
+.footer ul li {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    display: inline-block;
+    text-transform: lowercase;
+}
+.footer ul li:after {content:" | "}
+.footer ul li:last-child:after {content:"";}
+.footer p {margin: 0; text-align: right; padding-right: 3px;}
+.footer a {text-decoration: none; color: #539def; margin: 0 10px;}
+.footer li:first-child a {margin-left: 4px;}
+.footer a:hover, .footer a:active {text-decoration: underline;}
\ No newline at end of file
diff --git a/img/4.png b/img/4.png
new file mode 100644
index 0000000..c75a6fe
Binary files /dev/null and b/img/4.png differ
diff --git a/img/facebook-wrap.png b/img/facebook-wrap.png
new file mode 100644
index 0000000..343fb24
Binary files /dev/null and b/img/facebook-wrap.png differ
diff --git a/img/linkedin.png b/img/linkedin.png
new file mode 100644
index 0000000..c75a6fe
Binary files /dev/null and b/img/linkedin.png differ
diff --git a/img/result.php b/img/result.php
new file mode 100644
index 0000000..585d019
--- /dev/null
+++ b/img/result.php
@@ -0,0 +1,43 @@
+<?php  
+$name = $_POST["name"];
+
+try {
+	$db = new PDO("mysql:host=localhost;dbname=cbhuatus_miRNA;port=3306","cbhuatus_hu","H123h");
+	$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
+} catch(Exception $e){
+	echo"Could not connect to the database.";
+	exit;
+}
+try {
+	$results = $db->query("SELECT * FROM mirna WHERE Name LIKE '%$name%' ORDER BY databaseid ASC");
+	
+} catch(Exception $e){
+	echo"Could not query the database.";
+	exit;
+} 
+$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
+$total_n = sizeof($mirnas);
+$pageTitle = "Search Results";
+include ("inc/header.php");
+?>
+
+
+<?php
+echo "<pre>"; 
+echo "<h1 class= 'mirna'>Your search: ". $name .", return ". $total_n . " result(s) </h1>";
+
+if($total_n>0)
+{ 
+echo "<h2 class= 'mirna'>\nClick the name of miRNA for more information \n\n</h2>" ;
+
+for ($x=0; $x<$total_n; $x++) {
+	$mirna_name = $mirnas[$x]["Name"];
+	echo "<a href = ";
+	echo '"mirna.php?new=';
+        echo $mirna_name;
+	echo ' ">'. $mirna_name."</a><br>";
+
+    }
+}
+include ("inc/footer.php");
+?>
diff --git a/inc/config.php b/inc/config.php
new file mode 100644
index 0000000..e44bd22
--- /dev/null
+++ b/inc/config.php
@@ -0,0 +1,3 @@
+<?php
+define("WEB_ROOT", "/MRCD/");
+define("ROOT_PATH", $_SERVER["DOCUMENT_ROOT"] . "/MRCD/");
diff --git a/inc/footer.php b/inc/footer.php
new file mode 100644
index 0000000..c0a0805
--- /dev/null
+++ b/inc/footer.php
@@ -0,0 +1,8 @@
+</div>
+    <footer>
+      <a href="https://www.linkedin.com/pub/chengbin-hu/60/7ab/724"><img src="img/linkedin.png" alt="Linkedin Logo" class="social"></a>
+      <a href="https://www.facebook.com/chengbin.hu.5"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social"></a>
+      <p>&copy; 2015 Chengbin Hu</p>
+    </footer>
+  </body>
+</html>
diff --git a/inc/header.php b/inc/header.php
new file mode 100644
index 0000000..aff1a75
--- /dev/null
+++ b/inc/header.php
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+  <head>
+   
+    <meta charset="utf-8">
+    <title><?php echo $pageTitle ?></title>
+    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/normalize.css">
+    <link href='http://fonts.googleapis.com/css?family=Lato|Changa+One:400,400italic|Open+Sans:400,700' rel='stylesheet' type='text/css'>
+    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/main.css">
+    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/response.css">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  </head>
+  <body>
+    <header>
+  	  <a href="../index.html" id="logo">
+        <h1>Welecome to miRNA Database </h1>
+        <h2>Play big, Go big.</h2>
+      </a>
+      <nav>
+        <ul>
+          <li><a href="../index.html">Portfolio</a></li>
+          <li><a href="../about.html">About</a></li>
+          <li><a href="../contact.php">Contact</a></li>
+        </ul>
+      </nav>
+    </header>
+    <div id="wrapper">
diff --git a/inc/mirnatable.html.php b/inc/mirnatable.html.php
new file mode 100644
index 0000000..5c00678
--- /dev/null
+++ b/inc/mirnatable.html.php
@@ -0,0 +1,87 @@
+<table cellspacing="4" cellpadding="5" style="text-align: left;vertical-align:top;" id="table1" class="table table-stats table-bordered">
+	<thead>
+		<tr><th width="100px">Name</th><th with="300px">Value</th></tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td>
+				<b>databaseID</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["databaseid"];?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>pubmedID</b>
+			</td>
+			<td>
+				<a href= "http://www.ncbi.nlm.nih.gov/pubmed/<?php echo $mirnas[0]["Pubmed_ID"].'"'; ?>> <?php echo $mirnas[0]["Pubmed_ID"]; ?></a>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>tissue</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["tissue"]; ?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>microRNAs</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Name"]; ?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>miRBase</b>
+			</td>
+			<td>
+				<a href="http://www.mirbase.org/cgi-bin/query.pl?terms=<?php echo $mirnas[0]["Name"].'"'; ?>><?php echo $mirnas[0]["Name"]; ?></a>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>Main targets</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Main_Target"]; ?>			
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>Main Pathways</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Main_Pathway"]; ?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>miRNA function</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Fucntion_"]; ?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>Expression</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Expression"]; ?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<b>Cancer Effect</b>
+			</td>
+			<td>
+				<?php echo $mirnas[0]["Cancer_Effect"]; ?>
+			</td>
+		</tr>
+	</tbody>
+</table>
\ No newline at end of file
diff --git a/inc/model.php b/inc/model.php
new file mode 100644
index 0000000..f5e3361
--- /dev/null
+++ b/inc/model.php
@@ -0,0 +1,94 @@
+<?php
+
+class rna_database{
+	public function __construct($db_name){
+		try {
+			$this->db = new PDO("mysql:host=localhost;dbname=$db_name;port=3306","hu","");
+			$this->db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
+			} catch(Exception $e){
+			echo"Could not connect to the database.";
+			exit;
+		}
+	}
+
+	function select_single_rna($new){
+
+	try {
+		$results = $this->db->prepare("SELECT * FROM `mirna` WHERE Name = ?");
+		$results->bindParam(1,$new);
+		$results->execute();
+		} catch(Exception $e)
+		{
+			echo"Could not query the database.";
+			exit;
+		}
+	$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
+	return $mirnas;
+	}
+
+	function count_rna($name,$tissue,$onc=''){
+		try {
+		  if($tissue == "all"){
+		  	$total = $this->db->prepare("SELECT count(*) FROM mirna WHERE Name LIKE ? AND Cancer_Effect LIKE ?");
+		  	$total->bindValue(1,"%" . $name . "%");
+		  	$total->bindValue(2,"%" . $onc . "%");
+		  	$total->execute();
+			} else {
+				$total = $this->db->prepare("SELECT count(*) FROM mirna WHERE Name LIKE ? AND tissue = ? AND Cancer_Effect LIKE ?");
+		  		$total->bindValue(1,"%" . $name . "%");
+		  		$total->bindParam(2,$tissue);
+		  		$total->bindValue(3,"%" . $onc . "%");
+		  		$total->execute();
+		  }
+		} catch(Exception $e){
+			echo"Could not query the database.";
+			exit;
+		} 
+		$arr = $total->fetchAll(PDO::FETCH_ASSOC);
+		$total_n = intval($arr[0]["count(*)"]);
+		return $total_n;
+	}
+	function select_rnas($name,$tissue,$records_perpage=100,$c_p=0,$onc=''){
+		try {
+		  if($tissue == "all"){
+			$results = $this->db->prepare("SELECT * FROM mirna WHERE Name LIKE ? AND Cancer_Effect LIKE ? ORDER BY databaseid ASC LIMIT ? OFFSET ?");
+		  	$results->bindValue(1,"%" . $name . "%");
+		  	$results->bindValue(2,"%" . $onc . "%");
+		  	$results->bindParam(3,$records_perpage,PDO::PARAM_INT);
+		  	$results->bindParam(4,$c_p,PDO::PARAM_INT);
+		  	$results->execute();
+			} else {
+		  		$results = $this->db->prepare("SELECT * FROM mirna WHERE Name LIKE ? AND tissue = ? AND Cancer_Effect LIKE ? ORDER BY databaseid ASC LIMIT ? OFFSET ?");
+		  		$results->bindValue(1,"%" . $name . "%");
+		  		$total->bindParam(2,$tissue);
+		  		$results->bindValue(3,"%" . $onc . "%");
+		  		$results->bindParam(4,$records_perpage,PDO::PARAM_INT);
+		  		$results->bindParam(5,$c_p,PDO::PARAM_INT);
+		  		$results->execute();
+		  }
+		} catch(Exception $e){
+			echo"Could not query the database.";
+			exit;
+			} 
+		$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
+		return $mirnas;
+
+	}
+
+
+}
+
+function print_rna_link($mirnas){
+	$link = "";
+	foreach ($mirnas as $mirna) {
+	$mirna_name = $mirna["Name"];
+	$link .= "<a href = ";
+	$link .='"mirna.php?new=';
+    $link .= $mirna_name;
+	$link .=' " class="mirnalist">'. $mirna_name."</a><br>";
+	}
+	return $link;
+
+}
+
+
diff --git a/inc/pagenation.html.php b/inc/pagenation.html.php
new file mode 100644
index 0000000..2f83902
--- /dev/null
+++ b/inc/pagenation.html.php
@@ -0,0 +1,13 @@
+				<div class="pagination">
+
+					<?php $i = 0; ?>
+					<?php while ($i < $total_pagenum) : ?>
+						<?php $i += 1; ?>
+						<?php if ($i == $current_page) : ?>
+							<span><?php echo $i; ?></span>
+						<?php else : ?>
+							<a href="./result.php?name=<?php echo $name; ?>&tissue=<?php echo $tissue; ?>&p=<?php echo $i; ?>"><?php echo $i; ?></a>
+						<?php endif; ?>
+					<?php endwhile; ?>
+
+				</div>
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..f71ba94
--- /dev/null
+++ b/index.php
@@ -0,0 +1,59 @@
+<?php require_once("inc/config.php"); ?>
+
+<!DOCTYPE html>
+<html>
+  <head>
+   
+    <meta charset="utf-8">
+    <title>Structure Based Drug Design</title>
+	<meta name="viewport" content = "width=device-width, intitial-scale=1.0">
+    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/normalize.css">
+    <link href='http://fonts.googleapis.com/css?family=Lato|Changa+One:400,400italic|Open+Sans:400,700' rel='stylesheet' type='text/css'>
+	<link rel="stylesheet" href="<?php echo WEB_ROOT; ?>main.css">
+	
+    
+
+  </head>
+  <body>
+	<div class="wwww">
+        <h1>Welcome to miRNA
+&nbsp;of Cancer Database(MRCD) demo version 0.11</h1>
+        <table border="0">
+            <thead>
+                <tr>
+                    <th>MRCD offers miRNA target information related to cancer.</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>To check details of a miRNA, type one miRNA:</td>
+                </tr>
+                <tr>
+                    <th>
+	
+                      <form method = "get" action= "result.php" ><label for = "name">Search a miRNA:</br></label> 
+                          <input type="text" name="name" id="name"><br><br> 
+                          <label for = "tissue">Tissue:</br></label>
+                          <select name = "tissue" id= "tissue">
+                             <option value = "all">All</option>
+                             <option value = "liver">Liver</option>
+                             <option value = "blood">Blood</option>
+                             <option value = "breast">Breast</option>
+                          </select>
+
+                          <input type="submit" value="Submit">
+                      </form>
+		                </th>
+			
+                </tr>
+
+            </tbody>
+        </table>
+	</div>
+	<footer>
+           <p>&copy; <script type="text/javascript"> var d = new Date();
+			document.write(d.getFullYear());
+		</script> Chengbin Hu</p>
+    </footer>
+  </body>
+</html>
diff --git a/main.css b/main.css
new file mode 100644
index 0000000..2d32cfe
--- /dev/null
+++ b/main.css
@@ -0,0 +1,60 @@
+
+/* 
+    Created on : Dec 17, 2014, 5:34:35 PM
+    Author     : chengbin
+*/
+
+body {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 1em;
+    padding: 50px;
+    color: #555;
+}
+
+h1 {
+    text-align: left;
+    letter-spacing: 2px;
+    font-size: 1.1em;
+    color: #be7429;
+    font-weight: normal;
+    width: 650px;
+}
+
+table {
+    width: 650px;
+    padding: 10px;
+    background-color: #c5e7e0;
+}
+
+th {
+    text-align: left;
+    padding: 10px;
+    border-bottom: 1px solid;
+}
+
+td {
+    padding: 10px;
+}
+
+a:link {
+   color: #be7429;
+   font-weight: normal;
+   text-decoration: none;
+}
+
+a:link:hover {
+   color: #be7429;
+   font-weight: normal;
+   text-decoration: underline;
+}
+.wwww {
+
+  max-width: 940px;
+  margin: 0 auto;
+}
+
+footer {
+
+  max-width: 940px;
+  margin: 0 auto;
+}
diff --git a/mirna.php b/mirna.php
new file mode 100644
index 0000000..a55bb30
--- /dev/null
+++ b/mirna.php
@@ -0,0 +1,20 @@
+<?php
+require_once("inc/config.php");
+require_once(ROOT_PATH."inc/model.php");
+$new = $_GET['new'];
+
+$pageTitle = "miRNA: ". $new;
+
+$rna_db = new rna_database("cbhuatus_miRNA");
+$mirnas = $rna_db->select_single_rna($new);
+
+if(!count($mirnas)){
+	header ("Location: ./");
+	exit();
+}
+include (ROOT_PATH."inc/header.php");
+
+include (ROOT_PATH."inc/mirnatable.html.php");
+
+include (ROOT_PATH."inc/footer.php");
+?>
diff --git a/result.php b/result.php
new file mode 100644
index 0000000..bcec348
--- /dev/null
+++ b/result.php
@@ -0,0 +1,52 @@
+<?php 
+require_once("inc/config.php");
+require_once(ROOT_PATH."inc/model.php");
+$name = $_GET["name"];
+$tissue = $_GET["tissue"];
+if(isset($_GET["p"])){
+	$current_page = $_GET["p"];
+} else {
+	$current_page = 1;
+}
+//display 3 records per page
+$records_perpage = 3;
+$c_p=($current_page-1)*$records_perpage;
+
+//rna _db operation code.
+$rna_db = new rna_database("cbhuatus_miRNA"); //rna database class in model.php
+$total_n = $rna_db->count_rna($name,$tissue);
+$mirnas = $rna_db->select_rnas($name,$tissue,$records_perpage,$c_p); // select rna at name tissue records_page page.
+$total_pagenum = ceil($total_n/$records_perpage);
+
+
+//Now begin our pages.
+$pageTitle = "Search Results";
+include (ROOT_PATH."inc/header.php");
+?>
+<a href = "./">
+<?php
+echo "<h1 class= 'mirna'>Your search: ". $name ." Tissue: ".$tissue.", return ". $total_n . " result(s) </h1>";
+?>
+
+
+<h1 class= 'mirna'>Back to Search</h1></a>
+
+<h2 class= 'mirna'>Total pages: 
+
+<?php 
+
+echo $total_pagenum.". ";
+echo "Current page: ".$current_page.". "."</h2>";
+
+if($total_n>0)
+{ 
+echo "<h2 class= 'mirna'>\nClick the name of miRNA for more information \n\n</h2>" ; 
+include(ROOT_PATH."inc/pagenation.html.php");
+
+echo print_rna_link($mirnas);
+
+}
+include (ROOT_PATH."inc/footer.php");
+
+
+?>
\ No newline at end of file

Fixed code: php_errorlog
# miRNA_Database_by_PHP_MySql
Hi, Welecome to my first version of PHP/MySql database management Web application.

The inc/model.php contains rna_database class code of database management.

for web access, please visit 
'<a href = "http://www.cbhuatusf.com/MRCD/"> MRCD database</a>';
Thank you.

a {
  text-decoration: none;
}

body {
  font-family: 'Open Sans', sans-serif;
}


#wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding:0 5%;
}

#logo {
  text-align: center;
  margin: 0; 

}
/* link color */
a {
  color:#6ab47b;
}

img {
  max-width: 100%
}

/* green header*/
header {
  padding: 10px 0 0 0;
  background: #6ab47b;
  border-color:#599a68;
}
header {
	float: left;
	margin: 0 0 30px 0;
	padding: 5px 0 0 0;
	width: 100%;
}
h1, h2 {
  color:#fff;
}

h1 {
  font-family: 'Changa One', sans-serif;
  margin: 5px 0;
  font-size: 1.5em;
  font-weight: normal;
  line-height: 1.8em;/* for paragarph space*/
}

h2 {
  font-family: 'Lato', sans-serif;
  font-size: 1.25em; 
  margin: 5px 0 0;
  font-weight: normal;
}

nav {
  text-align: center;
  padding: 0px 30px 0px 0;
  margin: 20px 0 0;
}

footer{
  font-size: 0.74em;
  text-align: center;
  clear: both;
  padding-top: 50px;
  color: #555;
}
.social {
	width:20px;
	height:20px;
	margin:0 5px;
}

#ga {
  margin:0;
  padding: 0;
  list-style:none;
}

#ga li {
  float: left;
  width:45%;
  margin:2.5%;
  background-color:#f5f5f5;
  color: #bdc3c7;
  
}

#ga li a p {
  margin: 0;
  padding:5%;
  font-size:0.75em;
  color: #000000;
}


h1:hover, h2:hover {
  color:#32623f;
}

/* nav background for mobile */
nav {
  background:#599a68;
}

nav a, nav a:visited {
  color:#fff;
}

nav a.ss, nav a:hover {
  color:#32623f;
}
nav {
	text-align: center;
	padding: 10px 0;
	margin: 20px 0 0;

}

nav ul {
	list-style:none;
	margin:0 10px;
	padding:0;
}
nav li {
	display: inline-block;
}

nav a {
	font-weight:800;
	padding: 15px 10px;
}

body { /* site body */
  background-color:#fff;
  color:#888;
}
/* PAGE: About */
.profile-photo {
	display: block;  /*use block could enable auto to center element image default inline*/
	max-width: 150px;
	margin: 0 auto 30px; /*margin 3 numbers: top, leftright, bottom*/
	border-radius: 100%

}
h3 {
	margin:0 0 1em 0;
}
/* PAGE: contact */
.contact-info {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.9em;
}
.contact-info a {
	display: block;
	min-height:20px;
	background-repeat: no-repeat;
	background-size: 20px 20px;
	padding:0 0 0 30px;
	margin: 0 0 10px;
}

.contact-info li.phone a {
	background-image: url('../img/phone.png');
}
.contact-info li.mail a {
	background-image: url('../img/mail.png');
}
.mirna {
	color: #000;
	display: block;
	text-align: left;

}
.mirnalist {
	color:darkgreen;
	text-align: left;
	float: left;
	text-decoration:underline;
}

element.style {
text-align: left;
vertical-align: top;
}
.table-stats.table-bordered {

}
.table-stats {
border: 1px solid #C2C2C2;
border-collapse: separate;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0 !important;
font-family: verdana,helvetica,arial,sans-serif;
font-size: 11px;
color: #333;
}
.table-bordered {
border: 1px solid #dddddd;

border-collapse: separate;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.table {
width: 100%;
margin-bottom: 18px;
}


td {
text-align: left;
vertical-align: top;
}



table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
}
table {
max-width: 100%;
border-collapse: collapse;
border-spacing: 0;
background-color: transparent;
}
table
{
text-align: center;
background: #EEEEEE;
margin-right: auto;
margin-left: auto;
}
table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
}
table {
max-width: 100%;
border-collapse: collapse;
border-spacing: 0;
background-color: transparent;
}

table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
}

table {
border-spacing: 4px;
}
table {
max-width: 100%;
border-collapse: collapse;
border-spacing: 0;
background-color: transparent;
}
.pagination {
text-align: right;
margin: 1em 0;
}
div {
display: block;
}
.pagination span {
background: #CCC;
border-color: #999;
color: #444;
}
.pagination a, .pagination span {
padding: 0px 5px;
border: 1px solid #e3e1e0;
display: inline-block;
text-decoration: none;
color: #676767;
}

/*! normalize.css v1.1.0 | MIT License | git.io/normalize */

/* ==========================================================================
   HTML5 display definitions
   ========================================================================== */

/**
 * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
 */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
    display: block;
}

/**
 * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
 */

audio,
canvas,
video {
    display: inline-block;
    *display: inline;
    *zoom: 1;
}

/**
 * Prevent modern browsers from displaying `audio` without controls.
 * Remove excess height in iOS 5 devices.
 */

audio:not([controls]) {
    display: none;
    height: 0;
}

/**
 * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
 * Known issue: no IE 6 support.
 */

[hidden] {
    display: none;
}

/* ==========================================================================
   Base
   ========================================================================== */

/**
 * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
 *    `em` units.
 * 2. Prevent iOS text size adjust after orientation change, without disabling
 *    user zoom.
 */

html {
    font-size: 100%; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
    -ms-text-size-adjust: 100%; /* 2 */
}

/**
 * Address `font-family` inconsistency between `textarea` and other form
 * elements.
 */

html,
button,
input,
select,
textarea {
    font-family: sans-serif;
}

/**
 * Address margins handled incorrectly in IE 6/7.
 */

body {
    margin: 0;
}

/* ==========================================================================
   Links
   ========================================================================== */

/**
 * Address `outline` inconsistency between Chrome and other browsers.
 */

a:focus {
    outline: thin dotted;
}

/**
 * Improve readability when focused and also mouse hovered in all browsers.
 */

a:active,
a:hover {
    outline: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/**
 * Address font sizes and margins set differently in IE 6/7.
 * Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
 * and Chrome.
 */

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h2 {
    font-size: 1.5em;
    margin: 0.83em 0;
}

h3 {
    font-size: 1.17em;
    margin: 1em 0;
}

h4 {
    font-size: 1em;
    margin: 1.33em 0;
}

h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
}

h6 {
    font-size: 0.67em;
    margin: 2.33em 0;
}

/**
 * Address styling not present in IE 7/8/9, Safari 5, and Chrome.
 */

abbr[title] {
    border-bottom: 1px dotted;
}

/**
 * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
 */

b,
strong {
    font-weight: bold;
}

blockquote {
    margin: 1em 40px;
}

/**
 * Address styling not present in Safari 5 and Chrome.
 */

dfn {
    font-style: italic;
}

/**
 * Address differences between Firefox and other browsers.
 * Known issue: no IE 6/7 normalization.
 */

hr {
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    height: 0;
}

/**
 * Address styling not present in IE 6/7/8/9.
 */

mark {
    background: #ff0;
    color: #000;
}

/**
 * Address margins set differently in IE 6/7.
 */

p,
pre {
    margin: 1em 0;
}

/**
 * Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
 */

code,
kbd,
pre,
samp {
    font-family: monospace, serif;
    _font-family: 'courier new', monospace;
    font-size: 1em;
}

/**
 * Improve readability of pre-formatted text in all browsers.
 */

pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/**
 * Address CSS quotes not supported in IE 6/7.
 */

q {
    quotes: none;
}

/**
 * Address `quotes` property not supported in Safari 4.
 */

q:before,
q:after {
    content: '';
    content: none;
}

/**
 * Address inconsistent and variable font size in all browsers.
 */

small {
    font-size: 80%;
}

/**
 * Prevent `sub` and `sup` affecting `line-height` in all browsers.
 */

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* ==========================================================================
   Lists
   ========================================================================== */

/**
 * Address margins set differently in IE 6/7.
 */

dl,
menu,
ol,
ul {
    margin: 1em 0;
}

dd {
    margin: 0 0 0 40px;
}

/**
 * Address paddings set differently in IE 6/7.
 */

menu,
ol,
ul {
    padding: 0 0 0 40px;
}

/**
 * Correct list images handled incorrectly in IE 7.
 */

nav ul,
nav ol {
    list-style: none;
    list-style-image: none;
}

/* ==========================================================================
   Embedded content
   ========================================================================== */

/**
 * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
 * 2. Improve image quality when scaled in IE 7.
 */

img {
    border: 0; /* 1 */
    -ms-interpolation-mode: bicubic; /* 2 */
}

/**
 * Correct overflow displayed oddly in IE 9.
 */

svg:not(:root) {
    overflow: hidden;
}

/* ==========================================================================
   Figures
   ========================================================================== */

/**
 * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
 */

figure {
    margin: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

/**
 * Correct margin displayed oddly in IE 6/7.
 */

form {
    margin: 0;
}

/**
 * Define consistent border, margin, and padding.
 */

fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

/**
 * 1. Correct color not being inherited in IE 6/7/8/9.
 * 2. Correct text not wrapping in Firefox 3.
 * 3. Correct alignment displayed oddly in IE 6/7.
 */

legend {
    border: 0; /* 1 */
    padding: 0;
    white-space: normal; /* 2 */
    *margin-left: -7px; /* 3 */
}

/**
 * 1. Correct font size not being inherited in all browsers.
 * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
 *    and Chrome.
 * 3. Improve appearance and consistency in all browsers.
 */

button,
input,
select,
textarea {
    font-size: 100%; /* 1 */
    margin: 0; /* 2 */
    vertical-align: baseline; /* 3 */
    *vertical-align: middle; /* 3 */
}

/**
 * Address Firefox 3+ setting `line-height` on `input` using `!important` in
 * the UA stylesheet.
 */

button,
input {
    line-height: normal;
}

/**
 * Address inconsistent `text-transform` inheritance for `button` and `select`.
 * All other form control elements do not inherit `text-transform` values.
 * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
 * Correct `select` style inheritance in Firefox 4+ and Opera.
 */

button,
select {
    text-transform: none;
}

/**
 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Correct inability to style clickable `input` types in iOS.
 * 3. Improve usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
 *    Known issue: inner spacing remains in IE 6.
 */

button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button; /* 2 */
    cursor: pointer; /* 3 */
    *overflow: visible;  /* 4 */
}

/**
 * Re-set default cursor for disabled elements.
 */

button[disabled],
html input[disabled] {
    cursor: default;
}

/**
 * 1. Address box sizing set to content-box in IE 8/9.
 * 2. Remove excess padding in IE 8/9.
 * 3. Remove excess padding in IE 7.
 *    Known issue: excess padding remains in IE 6.
 */

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
    *height: 13px; /* 3 */
    *width: 13px; /* 3 */
}

/**
 * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
 * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
 *    (include `-moz` to future-proof).
 */

input[type="search"] {
    -webkit-appearance: textfield; /* 1 */
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box; /* 2 */
    box-sizing: content-box;
}

/**
 * Remove inner padding and search cancel button in Safari 5 and Chrome
 * on OS X.
 */

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/**
 * Remove inner padding and border in Firefox 3+.
 */

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/**
 * 1. Remove default vertical scrollbar in IE 6/7/8/9.
 * 2. Improve readability and alignment in all browsers.
 */

textarea {
    overflow: auto; /* 1 */
    vertical-align: top; /* 2 */
}

/* ==========================================================================
   Tables
   ========================================================================== */

/**
 * Remove most spacing between table cells.
 */

table {
    border-collapse: collapse;
    border-spacing: 0;
}
@media screen and (min-width: 480px) {
  /*********
  Two Column Layout
  ********/
  #primary{
    width: 35%;
    float: left;
    margin: 0 0 0 15%;  
  }
  
  #secondary {
    width: 40%;
    float: right;
  }
 /*********
  PAGE:Portfolio
  ********/
/*  #ga li{
    width:28.3333%;
  }
  #gi li:nth-child(4n){
    clear: left;
  }*/
}

@media screen and (min-width: 660px) {
 /*********
  PAGE:About
  ********/
  .profile-photo {
    float: left;
    margin: 0 15% 80px 0;
  }
 /*********
  Header
  ********/
  nav {
  background: none;
  float: right;
  font-size: 1.125em;
  margin-right: 5%;
  text-align: right;
  width: 45%;
  }
  #logo {
    float: left;
    margin-left: 5%;
    text-align: left;
    width: 45%;
  }
  h1{
    font-size: 1.5em;
  }
  h2 {
    font-size: 0.825em;
    margin-bottom: 20px;
  }
  header {
    border-bottom: 5px solid #599a68;
    margin-bottom:60px;
  }
}






/*! normalize.css - http://github.com/necolas/normalize.css */

/* ==========================================================================
   HTML5 display definitions
   ========================================================================== */

/*
 * Corrects `block` display not defined in IE6/7/8/9 & FF3.
 */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
    display: block;
}

/*
 * Corrects `inline-block` display not defined in IE6/7/8/9 & FF3.
 */

audio,
canvas,
video {
    display: inline-block;
    *display: inline;
    *zoom: 1;
}

/*
 * Prevents modern browsers from displaying `audio` without controls.
 * Remove excess height in iOS5 devices.
 */

audio:not([controls]) {
    display: none;
    height: 0;
}

/*
 * Addresses styling for `hidden` attribute not present in IE7/8/9, FF3, S4.
 * Known issue: no IE6 support.
 */

[hidden] {
    display: none;
}

/* ==========================================================================
   Base
   ========================================================================== */

/*
 * 1. Corrects text resizing oddly in IE6/7 when body `font-size` is set using
 *    `em` units.
 * 2. Prevents iOS text size adjust after orientation change, without disabling
 *    user zoom.
 */

html {
    font-size: 100%; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
    -ms-text-size-adjust: 100%; /* 2 */
}

/*
 * Addresses `font-family` inconsistency between `textarea` and other form
 * elements.
 */

html,
button,
input,
select,
textarea {
    font-family: sans-serif;
}

/*
 * Addresses margins handled incorrectly in IE6/7.
 */

body {
    margin: 0;
}

/* ==========================================================================
   Links
   ========================================================================== */

/*
 * Addresses `outline` inconsistency between Chrome and other browsers.
 */

a:focus {
    outline: thin dotted;
}

/*
 * Improves readability when focused and also mouse hovered in all browsers.
 * people.opera.com/patrickl/experiments/keyboard/test
 */

a:active,
a:hover {
    outline: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/*
 * Addresses font sizes and margins set differently in IE6/7.
 * Addresses font sizes within `section` and `article` in FF4+, Chrome, S5.
 */

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h2 {
    font-size: 1.5em;
    margin: 0.83em 0;
}

h3 {
    font-size: 1.17em;
    margin: 1em 0;
}

h4 {
    font-size: 1em;
    margin: 1.33em 0;
}

h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
}

h6 {
    font-size: 0.75em;
    margin: 2.33em 0;
}

/*
 * Addresses styling not present in IE7/8/9, S5, Chrome.
 */

abbr[title] {
    border-bottom: 1px dotted;
}

/*
 * Addresses style set to `bolder` in FF3+, S4/5, Chrome.
 */

b,
strong {
    font-weight: bold;
}

blockquote {
    margin: 1em 40px;
}

/*
 * Addresses styling not present in S5, Chrome.
 */

dfn {
    font-style: italic;
}

/*
 * Addresses styling not present in IE6/7/8/9.
 */

mark {
    background: #ff0;
    color: #000;
}

/*
 * Addresses margins set differently in IE6/7.
 */

p,
pre {
    margin: 1em 0;
}

/*
 * Corrects font family set oddly in IE6, S4/5, Chrome.
 * en.wikipedia.org/wiki/User:Davidgothberg/Test59
 */

code,
kbd,
pre,
samp {
    font-family: monospace, serif;
    _font-family: 'courier new', monospace;
    font-size: 1em;
}

/*
 * Improves readability of pre-formatted text in all browsers.
 */

pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/*
 * Addresses CSS quotes not supported in IE6/7.
 */

q {
    quotes: none;
}

/*
 * Addresses `quotes` property not supported in S4.
 */

q:before,
q:after {
    content: '';
    content: none;
}

small {
    font-size: 75%;
}

/*
 * Prevents `sub` and `sup` affecting `line-height` in all browsers.
 * gist.github.com/413930
 */

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* ==========================================================================
   Lists
   ========================================================================== */

/*
 * Addresses margins set differently in IE6/7.
 */

dl,
menu,
ol,
ul {
    margin: 1em 0;
}

dd {
    margin: 0 0 0 40px;
}

/*
 * Addresses paddings set differently in IE6/7.
 */

menu,
ol,
ul {
    padding: 0 0 0 40px;
}

/*
 * Corrects list images handled incorrectly in IE7.
 */

nav ul,
nav ol {
    list-style: none;
    list-style-image: none;
}

/* ==========================================================================
   Embedded content
   ========================================================================== */

/*
 * 1. Removes border when inside `a` element in IE6/7/8/9, FF3.
 * 2. Improves image quality when scaled in IE7.
 *    code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
 */

img {
    border: 0; /* 1 */
    -ms-interpolation-mode: bicubic; /* 2 */
}

/*
 * Corrects overflow displayed oddly in IE9.
 */

svg:not(:root) {
    overflow: hidden;
}

/* ==========================================================================
   Figures
   ========================================================================== */

/*
 * Addresses margin not present in IE6/7/8/9, S5, O11.
 */

figure {
    margin: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

/*
 * Corrects margin displayed oddly in IE6/7.
 */

form {
    margin: 0;
}

/*
 * Define consistent border, margin, and padding.
 */

fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

/*
 * 1. Corrects color not being inherited in IE6/7/8/9.
 * 2. Corrects text not wrapping in FF3.
 * 3. Corrects alignment displayed oddly in IE6/7.
 */

legend {
    border: 0; /* 1 */
    padding: 0;
    white-space: normal; /* 2 */
    *margin-left: -7px; /* 3 */
}

/*
 * 1. Corrects font size not being inherited in all browsers.
 * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome.
 * 3. Improves appearance and consistency in all browsers.
 */

button,
input,
select,
textarea {
    font-size: 100%; /* 1 */
    margin: 0; /* 2 */
    vertical-align: baseline; /* 3 */
    *vertical-align: middle; /* 3 */
}

/*
 * Addresses FF3/4 setting `line-height` on `input` using `!important` in the
 * UA stylesheet.
 */

button,
input {
    line-height: normal;
}

/*
 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Corrects inability to style clickable `input` types in iOS.
 * 3. Improves usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. Removes inner spacing in IE7 without affecting normal text inputs.
 *    Known issue: inner spacing remains in IE6.
 */

button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button; /* 2 */
    cursor: pointer; /* 3 */
    *overflow: visible;  /* 4 */
}

/*
 * Re-set default cursor for disabled elements.
 */

button[disabled],
input[disabled] {
    cursor: default;
}

/*
 * 1. Addresses box sizing set to content-box in IE8/9.
 * 2. Removes excess padding in IE8/9.
 * 3. Removes excess padding in IE7.
 *    Known issue: excess padding remains in IE6.
 */

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
    *height: 13px; /* 3 */
    *width: 13px; /* 3 */
}

/*
 * 1. Addresses `appearance` set to `searchfield` in S5, Chrome.
 * 2. Addresses `box-sizing` set to `border-box` in S5, Chrome (include `-moz`
 *    to future-proof).
 */

input[type="search"] {
    -webkit-appearance: textfield; /* 1 */
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box; /* 2 */
    box-sizing: content-box;
}

/*
 * Removes inner padding and search cancel button in S5, Chrome on OS X.
 */

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/*
 * Removes inner padding and border in FF3+.
 */

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/*
 * 1. Removes default vertical scrollbar in IE6/7/8/9.
 * 2. Improves readability and alignment in all browsers.
 */

textarea {
    overflow: auto; /* 1 */
    vertical-align: top; /* 2 */
}

/* ==========================================================================
   Tables
   ========================================================================== */

/*
 * Remove most spacing between table cells.
 */

table {
    border-collapse: collapse;
    border-spacing: 0;
}


html {overflow-y: scroll; overflow-x: hidden;}
body {font-family: 'Oswald', sans-serif; background:#f0eeed; color: #676767;}

.wrapper {width: 980px; margin: 0 auto;}
.header:after {content:"";height:0;display:block;visibility:hidden;clear:both;}
.header {background: #ff8400; border-bottom: 5px solid #f16702;}
.header .branding-title {float: left; margin: 0 0 0 12px; font: 0/0 serif; text-shadow: none; color: transparent; width:122px;height:77px;background:url(../img/branding-title.png) 0 14px no-repeat;padding: 14px 0;}
.header .branding-title a {display: block; height: 77px; width: 122px;}
.header .nav {float: right; top: 0; right: 0; margin: 0; position: relative; left: 15px; z-index: 99999999;}
.header .nav li {display: inline-block; margin: 0; list-style: none;}
.header .nav li.cart {margin-left: 64px; border: 0 solid #f16702; border-width: 0 8px;}
.header .nav li a {
    color: white;
    text-decoration: none;
    display: block;
    line-height: 95px;
    padding: 10px 0 0;
    margin: 0 0 0 50px;
    width: 90px;
    text-align: right;
    background: url('../img/nav-sprite.png') no-repeat 0px 105px;
    text-transform: uppercase;
    white-space: nowrap; 
}
.header .nav li.on a {text-decoration: underline;}
.header .nav li a:hover, .header .nav li a:active {color: #FFE200;}
.header .nav li.shirts a {background-position: 0px 0px;}
.header .nav li.contact a {background-position: 0px -105px;}
.header .nav li.cart a {
    width: 122px;
    font-size: 0/95px serif;
    text-shadow: none;
    color: transparent;
    background-position: 16px -216px;
    margin: 0;
}
.header .nav li.cart a:hover {background-position: 16px -321px;}
#content {min-height: 400px; background: white;}
.section.banner {height: 290px; background: #3d3d3d url('../img/banner-background.jpg') center center no-repeat;}
.section.banner .wrapper {position: relative;}
.section.banner .hero {position: absolute; top: -89px; left: 177px; z-index: 999;}
.section.banner .button {
    display: block;
    position: absolute;
    top: 97px;
    left: 590px;
    margin: 0;
    background-image: linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
    background-image: -o-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
    background-image: -moz-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
    background-image: -webkit-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
    background-image: -ms-linear-gradient(bottom, rgb(35,124,219) 0%, rgb(39,136,232) 16%, rgb(119,184,249) 100%);
    background-image: -webkit-gradient(
        linear,
        left bottom,
        left top,
        color-stop(0, rgb(35,124,219)),
        color-stop(0.16, rgb(39,136,232)),
        color-stop(1, rgb(119,184,249))
    );
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 5px solid #029af1;
    z-index: 0;
}
.section.banner a {
    width: 200px;
    padding: 20px 20px 20px 50px;
    display: block;
    text-decoration: none;
    background: url(../img/banner-link-arrow.png) 100% 50% no-repeat;
    color: #FFF;
}
.section.banner a:hover {
    color: #ffe200;
}
.section.banner h2 {
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    line-height: 1.3;
}
.section.banner p {
    color: #ffe200;
    font-style: italic;
    font-size: 14px;
    margin: 0;
}
.section.page:after {content:"";display:block;visibility:hidden;height:0;clear:both;}
.section.page {padding: 34px 0; background: white;}
.section.page h1 {
    font-size: 24px; 
    text-align: center;
    text-transform: uppercase;
    line-height: 1.6;
    font-weight: normal;    
}
.section.page .shirt-details h1 {
    text-align: left;
}
.section.page p {width: 375px; margin-left: auto; margin-right: auto; }
.section.page .shirt-details h1 .price {color: #9d9f4e; padding-right: 10px; font-size: 34px;}
.section.shirts {padding-bottom: 42px; background: #fff;}
.section.shirts h2 {
    font-size: 24px; 
    color: #c0bfbe;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.6;
    font-weight: normal;
}
.section.shirts ul.products {margin: 0 0 -17px 0; padding: 0; width: 997px;}
.section.shirts ul.products li {
    display: inline-block;
    list-style: none;
    border: 1px solid #e3e1e0;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    width: 202px;
    text-align: center;
    text-transform: lowercase;
    padding: 14px;
    background: #f0eeed;
    margin: 0 0 17px 17px;
    position: relative;
    left: -17px;
}
.section.shirts ul.products li a:hover:after {
    content: '+';
    font-size: 50px; position: absolute; top: -10px; right: 25px; color: #f16702; vertical-align: top;    
}
.section.shirts ul.products li a {
    background: white;
    display: block;
    padding: 30px 0 10px;
    text-decoration: none;
    color: #999;
    opacity: .9;
}
.section.shirts ul.products li a:hover {
    opacity: 1;
    color: #666;
}
.section.shirts ul.products li img {
    width: 190px;
}
.section.shirts ul.products li p {
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

.shirt-picture {
    float: left;
    width: 460px;
    text-align: center;
    border: 1px solid #d9d9d9;
    padding: 14px;
    background: #f0eeed;    
}
.shirt-picture span {
    background: white;
    display: block;
    width: 100%;
    padding: 36px 0 61px;
}
.shirt-picture img {width: 292px;}
.shirt-details {
    width: 460px;
    float: right;
}
.shirt-details form {
    margin-left: 0;
}
form {width: 375px; margin: 34px auto;}
form tr {
    border: 1px solid #CCC;
    background: #f4f3f2;
}
form table {width: 375px; margin-bottom: 16px;}
form th {
    width: 85px;
    border-right: 1px solid #CCC;
    vertical-align: middle;
    padding: 8px;
}
form td {
    padding: 15px 15px;
}
form td select,
form td input,
form td textarea {
    width: 100%;
}
form input[type="submit"] {
    width: 375px;
    text-align: center;
    border: 1px solid #8e8e46;
    background: #9c9f4e;
    color: #FFF;
    -webkit-border-radius: 2px;
    border-radius: 2px;    
    font-size: 14px;
    text-transform: uppercase;
    padding: 14px;
}
.breadcrumb {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: normal;
    padding: 14px 0 48px;
}
.note-designer {
    font-family: Georgia, serif;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
}

.footer {
    background: #f0eeed;
    padding: 42px 0;
    font-size: 12px;
    color: #a5a5a5;
    font-family: Helvetica, Arial, sans-serif;
}
.footer ul {margin: 0; padding: 0; float: left;}
.footer ul li {
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-block;
    text-transform: lowercase;
}
.footer ul li:after {content:" | "}
.footer ul li:last-child:after {content:"";}
.footer p {margin: 0; text-align: right; padding-right: 3px;}
.footer a {text-decoration: none; color: #539def; margin: 0 10px;}
.footer li:first-child a {margin-left: 4px;}
.footer a:hover, .footer a:active {text-decoration: underline;}
<?php  
$name = $_POST["name"];

try {
	$db = new PDO("mysql:host=localhost;dbname=cbhuatus_miRNA;port=3306","cbhuatus_hu","H123h");
	$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
} catch(Exception $e){
	echo"Could not connect to the database.";
	exit;
}
try {
	$results = $db->query("SELECT * FROM mirna WHERE Name LIKE '%$name%' ORDER BY databaseid ASC");
	
} catch(Exception $e){
	echo"Could not query the database.";
	exit;
} 
$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
$total_n = sizeof($mirnas);
$pageTitle = "Search Results";
include ("inc/header.php");
?>


<?php
echo "<pre>"; 
echo "<h1 class= 'mirna'>Your search: ". $name .", return ". $total_n . " result(s) </h1>";

if($total_n>0)
{ 
echo "<h2 class= 'mirna'>\nClick the name of miRNA for more information \n\n</h2>" ;

for ($x=0; $x<$total_n; $x++) {
	$mirna_name = $mirnas[$x]["Name"];
	echo "<a href = ";
	echo '"mirna.php?new=';
        echo $mirna_name;
	echo ' ">'. $mirna_name."</a><br>";

    }
}
include ("inc/footer.php");
?>
<?php
define("WEB_ROOT", "/MRCD/");
define("ROOT_PATH", $_SERVER["DOCUMENT_ROOT"] . "/MRCD/");
</div>
    <footer>
      <a href="https://www.linkedin.com/pub/chengbin-hu/60/7ab/724"><img src="img/linkedin.png" alt="Linkedin Logo" class="social"></a>
      <a href="https://www.facebook.com/chengbin.hu.5"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social"></a>
      <p>&copy; 2015 Chengbin Hu</p>
    </footer>
  </body>
</html>
<!DOCTYPE html>
<html>
  <head>
   
    <meta charset="utf-8">
    <title><?php echo $pageTitle ?></title>
    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/normalize.css">
    <link href='http://fonts.googleapis.com/css?family=Lato|Changa+One:400,400italic|Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/main.css">
    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/response.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <header>
  	  <a href="../index.html" id="logo">
        <h1>Welecome to miRNA Database </h1>
        <h2>Play big, Go big.</h2>
      </a>
      <nav>
        <ul>
          <li><a href="../index.html">Portfolio</a></li>
          <li><a href="../about.html">About</a></li>
          <li><a href="../contact.php">Contact</a></li>
        </ul>
      </nav>
    </header>
    <div id="wrapper">
<table cellspacing="4" cellpadding="5" style="text-align: left;vertical-align:top;" id="table1" class="table table-stats table-bordered">
	<thead>
		<tr><th width="100px">Name</th><th with="300px">Value</th></tr>
	</thead>
	<tbody>
		<tr>
			<td>
				<b>databaseID</b>
			</td>
			<td>
				<?php echo $mirnas[0]["databaseid"];?>
			</td>
		</tr>
		<tr>
			<td>
				<b>pubmedID</b>
			</td>
			<td>
				<a href= "http://www.ncbi.nlm.nih.gov/pubmed/<?php echo $mirnas[0]["Pubmed_ID"].'"'; ?>> <?php echo $mirnas[0]["Pubmed_ID"]; ?></a>
			</td>
		</tr>
		<tr>
			<td>
				<b>tissue</b>
			</td>
			<td>
				<?php echo $mirnas[0]["tissue"]; ?>
			</td>
		</tr>
		<tr>
			<td>
				<b>microRNAs</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Name"]; ?>
			</td>
		</tr>
		<tr>
			<td>
				<b>miRBase</b>
			</td>
			<td>
				<a href="http://www.mirbase.org/cgi-bin/query.pl?terms=<?php echo $mirnas[0]["Name"].'"'; ?>><?php echo $mirnas[0]["Name"]; ?></a>
			</td>
		</tr>
		<tr>
			<td>
				<b>Main targets</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Main_Target"]; ?>			
			</td>
		</tr>
		<tr>
			<td>
				<b>Main Pathways</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Main_Pathway"]; ?>
			</td>
		</tr>
		<tr>
			<td>
				<b>miRNA function</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Fucntion_"]; ?>
			</td>
		</tr>
		<tr>
			<td>
				<b>Expression</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Expression"]; ?>
			</td>
		</tr>
		<tr>
			<td>
				<b>Cancer Effect</b>
			</td>
			<td>
				<?php echo $mirnas[0]["Cancer_Effect"]; ?>
			</td>
		</tr>
	</tbody>
</table>
<?php

class rna_database{
	public function __construct($db_name){
		try {
			$this->db = new PDO("mysql:host=localhost;dbname=$db_name;port=3306","hu","");
			$this->db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
			} catch(Exception $e){
			echo"Could not connect to the database.";
			exit;
		}
	}

	function select_single_rna($new){

	try {
		$results = $this->db->prepare("SELECT * FROM `mirna` WHERE Name = ?");
		$results->bindParam(1,$new);
		$results->execute();
		} catch(Exception $e)
		{
			echo"Could not query the database.";
			exit;
		}
	$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
	return $mirnas;
	}

	function count_rna($name,$tissue,$onc=''){
		try {
		  if($tissue == "all"){
		  	$total = $this->db->prepare("SELECT count(*) FROM mirna WHERE Name LIKE ? AND Cancer_Effect LIKE ?");
		  	$total->bindValue(1,"%" . $name . "%");
		  	$total->bindValue(2,"%" . $onc . "%");
		  	$total->execute();
			} else {
				$total = $this->db->prepare("SELECT count(*) FROM mirna WHERE Name LIKE ? AND tissue = ? AND Cancer_Effect LIKE ?");
		  		$total->bindValue(1,"%" . $name . "%");
		  		$total->bindParam(2,$tissue);
		  		$total->bindValue(3,"%" . $onc . "%");
		  		$total->execute();
		  }
		} catch(Exception $e){
			echo"Could not query the database.";
			exit;
		} 
		$arr = $total->fetchAll(PDO::FETCH_ASSOC);
		$total_n = intval($arr[0]["count(*)"]);
		return $total_n;
	}
	function select_rnas($name,$tissue,$records_perpage=100,$c_p=0,$onc=''){
		try {
		  if($tissue == "all"){
			$results = $this->db->prepare("SELECT * FROM mirna WHERE Name LIKE ? AND Cancer_Effect LIKE ? ORDER BY databaseid ASC LIMIT ? OFFSET ?");
		  	$results->bindValue(1,"%" . $name . "%");
		  	$results->bindValue(2,"%" . $onc . "%");
		  	$results->bindParam(3,$records_perpage,PDO::PARAM_INT);
		  	$results->bindParam(4,$c_p,PDO::PARAM_INT);
		  	$results->execute();
			} else {
		  		$results = $this->db->prepare("SELECT * FROM mirna WHERE Name LIKE ? AND tissue = ? AND Cancer_Effect LIKE ? ORDER BY databaseid ASC LIMIT ? OFFSET ?");
		  		$results->bindValue(1,"%" . $name . "%");
		  		$total->bindParam(2,$tissue);
		  		$results->bindValue(3,"%" . $onc . "%");
		  		$results->bindParam(4,$records_perpage,PDO::PARAM_INT);
		  		$results->bindParam(5,$c_p,PDO::PARAM_INT);
		  		$results->execute();
		  }
		} catch(Exception $e){
			echo"Could not query the database.";
			exit;
			} 
		$mirnas = $results->fetchAll(PDO::FETCH_ASSOC);
		return $mirnas;

	}


}

function print_rna_link($mirnas){
	$link = "";
	foreach ($mirnas as $mirna) {
	$mirna_name = $mirna["Name"];
	$link .= "<a href = ";
	$link .='"mirna.php?new=';
    $link .= $mirna_name;
	$link .=' " class="mirnalist">'. $mirna_name."</a><br>";
	}
	return $link;

}


				<div class="pagination">

					<?php $i = 0; ?>
					<?php while ($i < $total_pagenum) : ?>
						<?php $i += 1; ?>
						<?php if ($i == $current_page) : ?>
							<span><?php echo $i; ?></span>
						<?php else : ?>
							<a href="./result.php?name=<?php echo $name; ?>&tissue=<?php echo $tissue; ?>&p=<?php echo $i; ?>"><?php echo $i; ?></a>
						<?php endif; ?>
					<?php endwhile; ?>

				</div>
<?php require_once("inc/config.php"); ?>

<!DOCTYPE html>
<html>
  <head>
   
    <meta charset="utf-8">
    <title>Structure Based Drug Design</title>
	<meta name="viewport" content = "width=device-width, intitial-scale=1.0">
    <link rel="stylesheet" href="<?php echo WEB_ROOT; ?>css/normalize.css">
    <link href='http://fonts.googleapis.com/css?family=Lato|Changa+One:400,400italic|Open+Sans:400,700' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="<?php echo WEB_ROOT; ?>main.css">
	
    

  </head>
  <body>
	<div class="wwww">
        <h1>Welcome to miRNA
&nbsp;of Cancer Database(MRCD) demo version 0.11</h1>
        <table border="0">
            <thead>
                <tr>
                    <th>MRCD offers miRNA target information related to cancer.</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>To check details of a miRNA, type one miRNA:</td>
                </tr>
                <tr>
                    <th>
	
                      <form method = "get" action= "result.php" ><label for = "name">Search a miRNA:</br></label> 
                          <input type="text" name="name" id="name"><br><br> 
                          <label for = "tissue">Tissue:</br></label>
                          <select name = "tissue" id= "tissue">
                             <option value = "all">All</option>
                             <option value = "liver">Liver</option>
                             <option value = "blood">Blood</option>
                             <option value = "breast">Breast</option>
                          </select>

                          <input type="submit" value="Submit">
                      </form>
		                </th>
			
                </tr>

            </tbody>
        </table>
	</div>
	<footer>
           <p>&copy; <script type="text/javascript"> var d = new Date();
			document.write(d.getFullYear());
		</script> Chengbin Hu</p>
    </footer>
  </body>
</html>

/* 
    Created on : Dec 17, 2014, 5:34:35 PM
    Author     : chengbin
*/

body {
    font-family: Verdana, Arial, sans-serif;
    font-size: 1em;
    padding: 50px;
    color: #555;
}

h1 {
    text-align: left;
    letter-spacing: 2px;
    font-size: 1.1em;
    color: #be7429;
    font-weight: normal;
    width: 650px;
}

table {
    width: 650px;
    padding: 10px;
    background-color: #c5e7e0;
}

th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid;
}

td {
    padding: 10px;
}

a:link {
   color: #be7429;
   font-weight: normal;
   text-decoration: none;
}

a:link:hover {
   color: #be7429;
   font-weight: normal;
   text-decoration: underline;
}
.wwww {

  max-width: 940px;
  margin: 0 auto;
}

footer {

  max-width: 940px;
  margin: 0 auto;
}
<?php
require_once("inc/config.php");
require_once(ROOT_PATH."inc/model.php");
$new = $_GET['new'];

$pageTitle = "miRNA: ". $new;

$rna_db = new rna_database("cbhuatus_miRNA");
$mirnas = $rna_db->select_single_rna($new);

if(!count($mirnas)){
	header ("Location: ./");
	exit();
}
include (ROOT_PATH."inc/header.php");

include (ROOT_PATH."inc/mirnatable.html.php");

include (ROOT_PATH."inc/footer.php");
?>
<?php 
require_once("inc/config.php");
require_once(ROOT_PATH."inc/model.php");
$name = $_GET["name"];
$tissue = $_GET["tissue"];
if(isset($_GET["p"])){
	$current_page = $_GET["p"];
} else {
	$current_page = 1;
}
//display 3 records per page
$records_perpage = 3;
$c_p=($current_page-1)*$records_perpage;

//rna _db operation code.
$rna_db = new rna_database("cbhuatus_miRNA"); //rna database class in model.php
$total_n = $rna_db->count_rna($name,$tissue);
$mirnas = $rna_db->select_rnas($name,$tissue,$records_perpage,$c_p); // select rna at name tissue records_page page.
$total_pagenum = ceil($total_n/$records_perpage);


//Now begin our pages.
$pageTitle = "Search Results";
include (ROOT_PATH."inc/header.php");
?>
<a href = "./">
<?php
echo "<h1 class= 'mirna'>Your search: ". $name ." Tissue: ".$tissue.", return ". $total_n . " result(s) </h1>";
?>


<h1 class= 'mirna'>Back to Search</h1></a>

<h2 class= 'mirna'>Total pages: 

<?php 

echo $total_pagenum.". ";
echo "Current page: ".$current_page.". "."</h2>";

if($total_n>0)
{ 
echo "<h2 class= 'mirna'>\nClick the name of miRNA for more information \n\n</h2>" ; 
include(ROOT_PATH."inc/pagenation.html.php");

echo print_rna_link($mirnas);

}
include (ROOT_PATH."inc/footer.php");


?>