0

我已经从 myisam 迁移到 innodb,我不得不从表中删除全文索引。现在我的脚本的某些部分不起作用,我如何转换下面的代码以便它可以与 innodb 一起使用?

$posts_fields = "SELECT SQL_CALC_FOUND_ROWS id, autor, " . PREFIX . "_post.date AS newsdate, " . PREFIX ."_post.date AS date, short_story AS story, " . PREFIX . "_post.xfields AS xfields, title, descr, keywords, category, alt_name,comm_num AS comm_in_news, allow_comm, rating, news_read, flag, editdate, editor, reason, view_edit, tags, '' AS output_comms";
$posts_from = "FROM " . PREFIX . "_post";
$sql_find = "$sql_fields $posts_from $where";
4

1 回答 1

0
$posts_fields = "SELECT SQL_CALC_FOUND_ROWS id, autor, " . PREFIX . "_post.date AS newsdate, " . PREFIX ."_post.date AS date, short_story AS story, " . PREFIX . "_post.xfields AS xfields, title, descr, keywords, category, alt_name,comm_num AS comm_in_news, allow_comm, rating, news_read, flag, editdate, editor, reason, view_edit, tags, '' AS output_comms";
$posts_from = "FROM " . PREFIX . "_post";
$sql_find = "$sql_fields $posts_from $where";

应该改为

$posts_fields = "SELECT SQL_CALC_FOUND_ROWS id, autor, " . PREFIX . "_post.date AS newsdate, " . PREFIX ."_post.date AS date, short_story AS story, " . PREFIX . "_post.xfields AS xfields, title, descr, keywords, category, alt_name,comm_num AS comm_in_news, allow_comm, rating, news_read, flag, editdate, editor, reason, view_edit, tags, '' AS output_comms";
$posts_from = "FROM " . PREFIX . "_post";
$sql_find = "$post_fields $posts_from $where";

并仔细检查您的 where 条件

于 2012-07-10T15:00:05.183 回答