PHP中的MySql查询mysql_query

时间:2016-01-23 12:29:38

标签: php mysql

我怎么能在php中查询?

SET @sql = NULL;
SELECT
  GROUP_CONCAT(DISTINCT
    CONCAT(
      'MAX(IF(property_name = ''',
      property_name,
      ''', value, NULL)) AS ',
      property_name
    )
  ) INTO @sql
FROM properties;
SET @sql = CONCAT('SELECT item_id, ', @sql, ' FROM properties GROUP BY item_id');

我试图复制它并收到错误,似乎我没有做好......

0 个答案:

没有答案