Created
August 23, 2012 18:00
-
-
Save hikari-no-yume/3439614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Profiles | CREATE TABLE `Profiles` ( | |
`ProfileID` int(11) NOT NULL AUTO_INCREMENT, | |
`ProfileName` varchar(18) DEFAULT NULL, | |
`DisplayName` varchar(255) NOT NULL, | |
`ProfileIMage` varchar(255) NOT NULL DEFAULT '/media/profileimages/ScoutBlue.png', | |
`RealName` varchar(255) DEFAULT NULL, | |
`Bio` text, | |
`Country` varchar(255) DEFAULT NULL, | |
`WebsiteURL` varchar(255) DEFAULT NULL, | |
`LastOnline` datetime NOT NULL, | |
`OnlineStatus` int(11) NOT NULL DEFAULT '1', | |
`LastNotification` int(11) NOT NULL DEFAULT '0', | |
`InGameName` varchar(255) DEFAULT NULL, | |
`InGameURL` varchar(255) DEFAULT NULL, | |
PRIMARY KEY (`ProfileID`), | |
FULLTEXT KEY `DisplayName` (`DisplayName`) | |
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | | |
SELECT DisplayName, ProfileID, ProfileImage, MATCH(DisplayName) AGAINST('$query') AS Relevance FROM Profiles WHERE MATCH(DisplayName) AGAINST('$query') ORDER BY Relevance DESC, LastOnline DESC, OnlineStatus DESC; | |
$query is 'Andrew Faulds', escaped (I will switch to parameterised queries later). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment