// Set DB access as constants define ('DB_USER2', 'canesfan_wowadmi'); define ('DB_PASSWORD2', 'capj20las'); define ('DB_HOST2', 'localhost'); define ('DB_NAME2', 'canesfan_insite'); // Connect to the database $db_link2 = @mysql_connect (DB_HOST2, DB_USER2, DB_PASSWORD2); // MySql connection string if ($db_link2) { // If connected, select the DB $db_selected = @mysql_select_db(DB_NAME2, $db_link2); // Database to connect to if (!$db_selected) { // If DB could not be selected echo "Could not select the database"; } } else { // If could not connect to DB echo "Could not connect to the database"; } // ======================================= \\ // Database Query Function \\ // ======================================= \\ function DBQuery ($query) { $result = mysql_query($query); $my_rows = array(); $total = mysql_num_rows($result); if ($total > 0) { mysql_data_seek($result, 0); while ($row = mysql_fetch_array($result)) { array_push($my_rows, $row); } } return $my_rows; } // ======================================= \\ // Database Insert Query Function \\ // ======================================= \\ function DBInsert ($query) { $result = mysql_query($query); $my_rows = mysql_insert_id(); return $my_rows; } // ======================================= \\ // Database Number of Rows Function \\ // ======================================= \\ function DBNumRows ($query) { $result = mysql_query($query); $my_rows = mysql_num_rows($result); return $my_rows; } // ======================================= \\ // Database Update Function \\ // ======================================= \\ function DBUpdate ($query) { $result = mysql_query($query); $my_rows = mysql_affected_rows(); return $my_rows; } // ======================================= \\ // Database Delete Query Function \\ // ======================================= \\ function DBDelete ($query) { $result = mysql_query($query); $my_rows = mysql_affected_rows(); return $my_rows; } ?>

|
Poll your visitors. Votes can be limited to allow only registered users or logged in members to vote. They can also allow only 1 vote per person. The vote system also be used to rate products and services. Votes are easily controlled from the CMS. You can add new questions, add answers to current votes and track results of past votes. |
No questions currently configured |