Unknown column 'c.ID_CAT' in 'on clause'

Started by Tangram, October 27, 2005, 08:55:50 AM

Previous topic - Next topic

Tangram

Been installing this marvelous product on my local system and managed to get through a number of problems.  There's still one which is defeating me though...

Database Error
Unknown column 'c.ID_CAT' in 'on clause'
File: c:\Inetpub\wwwroot\smf\Sources\BoardIndex.php
Line: 82 

This is being called up as a result of running the index.php.  All the other screens in admin seem to be working fine and I've built a couple of boards, which again appear to be OK.  I've checked out the database and there most certainly is a column ID_CAT in the categories table in the smf/mysql database.

Before I get shouted down..... I've looked through the help on these boards, and though I can see a number of people have also seen this issue (and I've followed the steps of running an update pack, which did cure a number of other problems) I've not found any other more helpfull suggestions beyond downloading the install again, uninstalling and reinstalling the product, which didn't help.

Any help here would be much appreciated.

Oldiesmann

Michael Eshom
Christian Metal Fans

Tangram

The latest.... V5.0.15

I tried uninstalling that and going for an earlier version, but I can't quickly find one on the MySql site any more.  I think I've got an old install (v4.??) at home.  Maybe I'll try that one tomorrow unless someones got a marvelous tweak that fixes the problem.  ::)

Oldiesmann

That would be the issue. SMF has not been tested with 5.0 because it just recently became available for production use. We may support that version in the future. Until then though, you can get MySQL 4.1 at http://dev.mysql.com/downloads/mysql/4.1.html
Michael Eshom
Christian Metal Fans

Tangram


Oldiesmann

Just dug up another topic on the issue - http://www.simplemachines.org/community/index.php?topic=50865.0

There's another one around here besides that one, but I can't find it at the moment.
Michael Eshom
Christian Metal Fans

Tangram

Thanks, Oldiesmann.  I downloaded and installed the version of the MySql you linked too and all is now well.  The boards running perfectly.  Thanks so much for your help.... Really appreciate it.  :-*

Oldiesmann

You're welcome. That issue should be fixed in the next version.
Michael Eshom
Christian Metal Fans

wlso

Do you know when that might be?  I have the same issue...however I can't install a previous version of mysql as its not my server....I'd really like to use this forum software but because of the bug I can't.

JayBachatero

Threre is no release date.  Here at SMF they just release it w/o saying when.  Did yu take a look at the fix he provided?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

wlso

The only fix I noticed was to download a previous version of mysql...and I can't do that due to the server setup.

JayBachatero

Quote from: dj-opie on September 25, 2005, 06:19:53 AM
I posted this elsewhere, but figured it needed to be brought to the attention of [unknown], et al.
Starting with MySql 5.0.12, join statements now follow the sql 2003 standard, and thus are a bit more picky about syntax.
Places like this in the forum code:
$request = db_query("
      SELECT
         m.posterTime, m.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG,
         IFNULL(mem.realName, m.posterName) AS posterName, t.ID_BOARD, b.name AS bName,
         LEFT(m.body, 384) AS body, m.smileysEnabled
      FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE m.ID_MSG >= " . max(0, $modSettings['maxMsgID'] - 20 * $showlatestcount) . "
         AND t.ID_TOPIC = m.ID_TOPIC
         AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
         AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
         AND $user_info[query_see_board]
      ORDER BY m.ID_MSG DESC
      LIMIT $showlatestcount", __FILE__, __LINE__);


need to have parentheses around the table names in the FROM section, or else it doesn't work and the forum dies.
I noticed this issue in a few files, including recent.php and repairboards.php.  I'm sure it exists elsewhere, as well.
This is in SMF 1.1RC1.



EDIT:
Fixed, the code should be:
$request = db_query("
      SELECT
         m.posterTime, m.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG,
         IFNULL(mem.realName, m.posterName) AS posterName, t.ID_BOARD, b.name AS bName,
         LEFT(m.body, 384) AS body, m.smileysEnabled
      FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE m.ID_MSG >= " . max(0, $modSettings['maxMsgID'] - 20 * $showlatestcount) . "
         AND t.ID_TOPIC = m.ID_TOPIC
         AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
         AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
         AND $user_info[query_see_board]
      ORDER BY m.ID_MSG DESC
      LIMIT $showlatestcount", __FILE__, __LINE__);

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert


JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: