CSCI 470 |
CREATE TABLE data ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255) NOT NULL, value VARCHAR(255) );
<?php $mysqli = mysqli_connect("localhost", "web_namevalues", "mysecret", "namevalues"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $sql = "SELECT * FROM data"; $res = mysqli_query($mysqli, $sql); if ($res) { while ($newArray = mysqli_fetch_array($res, MYSQLI_ASSOC)) { $name = $newArray['name']; $value = $newArray['value']; printf("Name '%s', value '%s'<br \>\n", $name, $value); } mysqli_free_result($res); } mysqli_close($mysqli); ?>
ft_stopword_file = "" ft_min_word_len = 1Note that you will need to reload the table containing the full-text index for this to take effect.
// Return an array of quotes based on the given set of search word(s), limit to max total quotations function getQuotes($search, $max) // Return an array of the most frequent commands given the current prefix, limit to at most max results. // If sessionID is set, include up to sessionMax results that are personalized based on the sessionID. function getTopMatches($prefix, $max, $sessionID = "", $sessionMax = 0) // Return an array of the newest searches, limit to at most max results function getTopRecentMatches($max) // Add a new search to the database from a user with the given ip and sessionID function addSearch($search, $ip, $sessionID) // Add/change rating for the quote identified by quoteID for user identified by sessionID // score is the star rating: 1, 2, 3, 4 or 5. function rateQuote($sessionID, $quoteID, $score) // Return the average score of this quote, "" if no score for the quote yet. // If sessionID not "", we return current score set by this user. function getQuoteScore($quoteID, $sessionID = "") // Deletes searches from the database, if sessionID is set only delete entries for that sessionID function deleteSearches($sessionID = "") // Deletes ratings from the database, if sessionID is set only delete entries for that sessionID function deleteRatings($sessionID = "")
Page last updated: December 30, 2014