Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
CREATE TABLE `friends` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(20) collate utf8_unicode_ci NOT NULL,
`friendname` varchar(20) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=14799 ;
INSERT INTO `friends` VALUES (123, 'GO6O', 'IWAN');
Както си го изкарваш нормално. fetch_assoc/array или там ако използваш PDO, MYSQLi.niksdevil каза:А как да изкарам резултата ?
$query = mysql_query("SELECT *, IF(`to` = '$req_user' OR `from` = '$session->username', `to`, `from`) friend
FROM friends
WHERE ( `from` = '$req_user' OR `from` ='$session->username') OR (`to` = '$req_user' OR `to` = '$session->username')
GROUP BY`to` HAVING COUNT(*) > 1
");
while($row = mysql_fetch_assoc($query)) {
//тук резултатите...
}