Допустим есть таблица:
SQL |
-- -- Структура таблицы `jos_joomleague_chara` -- CREATE TABLE IF NOT EXISTS `jos_joomleague_chara` ( `id` int(11) NOT NULL auto_increment, `id_hock` tinyint(11) NOT NULL, `pyatak` tinyint(4) NOT NULL default '0', `bort` tinyint(4) NOT NULL default '0', `cheki` tinyint(4) NOT NULL default '0', `kombi` tinyint(4) NOT NULL default '0', `skorost` tinyint(4) NOT NULL default '0', `sila` tinyint(4) NOT NULL default '0', `vinosl` tinyint(4) NOT NULL default '0', `dalnbro` tinyint(4) NOT NULL default '0', `blibro` tinyint(4) NOT NULL default '0', `starat` tinyint(4) NOT NULL default '0', `master` tinyint(4) NOT NULL default '0', `neravn` tinyint(4) NOT NULL default '0', `comment` text NOT NULL, `ip` mediumtext NOT NULL, `vote_rating` smallint(6) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ; |
PHP |
$query = "SELECT COUNT(*) FROM jos_joomleague_chara WHERE id_hock = $_GET[pid]"; |
PHP |
$query = "SELECT GREATEST (*) FROM jos_joomleague_chara WHERE id_hock = $_GET[pid]"; |
PHP |
<?php |
PHP |
<?php |