- 1
- 2
- 3
mysql_query(sprintf("insert into `spb_plusone_%ss`
values('%d','1') on duplicate key update `counter`=`counter`+1;", $_POST['type'], $_POST['id']), $conn);
$result = mysql_fetch_assoc(mysql_query(sprintf("select `counter` from `spb_plusone_%ss` where `%s`='%d'", $_POST['type'], ($_POST['type'] == 'node' ? 'nid' : 'fid'), $_POST['id']), $conn));
В рифму.
Пум-пум-пурум.
Кей упдате.
Пам-парам.