0

我有两个表,mailbox_conversation 和mailbox_message。两个表都有一个共同的列,conversation_id。mailbox_conversation 表还有其他名为 is_system 和主题的列。

如果满足以下条件,我想删除 mailbox_message 表中的特定对话 ID:

  • is_system =是
  • 主题不喜欢 %Gift from%

这是我写的代码:

$result42 = mysql_query("select * from ".TABLE_PREFIX."mailbox_message
         using ".TABLE_PREFIX."mailbox_conversation, ".TABLE_PREFIX."mailbox_message
          where ".TABLE_PREFIX."mailbox_conversation.conversation_id = ".TABLE_PREFIX."mailbox_message.conversation_id
        and ".TABLE_PREFIX."mailbox_conversation.subject NOT LIKE '%Gift from%'
         and ".TABLE_PREFIX."mailbox_conversation.is_system = 'yes' ");

$num42=mysql_numrows($result42);   **<<-- Line 73**

出于测试目的,我做了一个 select 语句并希望输出行数 $num42

这是我收到的错误:

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in
/home/mayhem/public_html/videochat/admin/erasesysmess.php on line 73

怎么了?

4

0 回答 0