News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

The database does not exist: is_approved ?

Started by xyxis_fahim, May 18, 2008, 03:58:58 PM

Previous topic - Next topic

xyxis_fahim

Hello,
When I try to merge a Topic in SMF 2 , and error reporting
"The database value you're trying to insert does not exist: is_approved"  comes on.

What may be the cause?

Thank you.

ONLiNEZONE

Quote from: xyxis_fahim on May 18, 2008, 03:58:58 PM
Hello,
When I try to merge a Topic in SMF 2 , and error reporting
"The database value you're trying to insert does not exist: is_approved"  comes on.

What may be the cause?

Thank you.

I think it might be an error in the database
If you use cPanel for WebServer Administration then tell me.
Regards,
Mark.

50 | 100 | 150 | 200 | 250 | 300...

xyxis_fahim


H

Are you running beta3?

Have you tried running Admin area > Forum Maintenance > Find and Repair errors?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Dragooon

OK Just looking at the code, I think it is a bug
See this query
$request = $smcFunc['db_query']('', '
SELECT t.id_topic, m.subject, m.id_member, IFNULL(mem.real_name, m.poster_name) AS poster_name
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE t.id_board = {int:id_board}
AND t.id_topic != {int:id_topic}' . ($onlyApproved ? '
AND t.approved = {int:is_approved}' : '') . '
ORDER BY {raw:sort}
LIMIT {int:offset}, {int:limit}',
array(
'id_board' => $_REQUEST['targetboard'],
'id_topic' => $_GET['from'],
'sort' => (!empty($modSettings['enableStickyTopics']) ? 't.is_sticky DESC, ' : '') . 't.id_last_msg DESC',
'offset' => $_REQUEST['start'],
'limit' => $modSettings['defaultMaxTopics'],
)
);

(Around line 898-915 in SplitTopics.php in the function MergeIndex)
There is AND t.approved = {int:is_approved} But no is_approved in the values array.

niko

This is fixed already.

adding 'is_aproved' => 1 to array should fix this.
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

ONLiNEZONE

Quote from: xyxis_fahim on May 20, 2008, 12:05:29 AM
Yes it is Cpanel.

Okay, login as the Administrator for cPanel.
Goto MySQL Databases. Find, Repair database's and then click your database for your forum.
then click repair.
Regards,
Mark.

50 | 100 | 150 | 200 | 250 | 300...

metallica48423

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

xyxis_fahim

Quote from: ONLiNEZONE on May 21, 2008, 07:05:10 PM
Okay, login as the Administrator for cPanel.
Goto MySQL Databases. Find, Repair database's and then click your database for your forum.
then click repair.

That didn't work ,Sorry.

Dragooon

The DB is fine.

Find
   $request = $smcFunc['db_query']('', '
      SELECT t.id_topic, m.subject, m.id_member, IFNULL(mem.real_name, m.poster_name) AS poster_name
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
      WHERE t.id_board = {int:id_board}
         AND t.id_topic != {int:id_topic}' . ($onlyApproved ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY {raw:sort}
      LIMIT {int:offset}, {int:limit}',
      array(
         'id_board' => $_REQUEST['targetboard'],
         'id_topic' => $_GET['from'],
         'sort' => (!empty($modSettings['enableStickyTopics']) ? 't.is_sticky DESC, ' : '') . 't.id_last_msg DESC',
         'offset' => $_REQUEST['start'],
         'limit' => $modSettings['defaultMaxTopics'],
      )
   );

And replace it with
   $request = $smcFunc['db_query']('', '
      SELECT t.id_topic, m.subject, m.id_member, IFNULL(mem.real_name, m.poster_name) AS poster_name
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
      WHERE t.id_board = {int:id_board}
         AND t.id_topic != {int:id_topic}' . ($onlyApproved ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY {raw:sort}
      LIMIT {int:offset}, {int:limit}',
      array(
         'id_board' => $_REQUEST['targetboard'],
         'id_topic' => $_GET['from'],
         'sort' => (!empty($modSettings['enableStickyTopics']) ? 't.is_sticky DESC, ' : '') . 't.id_last_msg DESC',
         'offset' => $_REQUEST['start'],
         'limit' => $modSettings['defaultMaxTopics'],
         'is_approved' => 1,
      )
   );

Rocks-HD

Quote from: Dragooon on May 22, 2008, 02:14:37 AM
The DB is fine.

Find
   $request = $smcFunc['db_query']('', '
      SELECT t.id_topic, m.subject, m.id_member, IFNULL(mem.real_name, m.poster_name) AS poster_name
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
      WHERE t.id_board = {int:id_board}
         AND t.id_topic != {int:id_topic}' . ($onlyApproved ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY {raw:sort}
      LIMIT {int:offset}, {int:limit}',
      array(
         'id_board' => $_REQUEST['targetboard'],
         'id_topic' => $_GET['from'],
         'sort' => (!empty($modSettings['enableStickyTopics']) ? 't.is_sticky DESC, ' : '') . 't.id_last_msg DESC',
         'offset' => $_REQUEST['start'],
         'limit' => $modSettings['defaultMaxTopics'],
      )
   );

And replace it with
   $request = $smcFunc['db_query']('', '
      SELECT t.id_topic, m.subject, m.id_member, IFNULL(mem.real_name, m.poster_name) AS poster_name
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
      WHERE t.id_board = {int:id_board}
         AND t.id_topic != {int:id_topic}' . ($onlyApproved ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY {raw:sort}
      LIMIT {int:offset}, {int:limit}',
      array(
         'id_board' => $_REQUEST['targetboard'],
         'id_topic' => $_GET['from'],
         'sort' => (!empty($modSettings['enableStickyTopics']) ? 't.is_sticky DESC, ' : '') . 't.id_last_msg DESC',
         'offset' => $_REQUEST['start'],
         'limit' => $modSettings['defaultMaxTopics'],
         'is_approved' => 1,
      )
   );

thanks man

My smf 2.0 beta 3.1 public had the same problem and with you help I can make work very well.

it's problem probably is because I had smf 1.1.4 and upgrade for smf 2.0

Thanks

Dragon41673

Hey guys, this thread is very old, but I'm having the same issue. If I need to start a new thread...that's fine.

I wasn't sure if I should use the same "fix" as listed above, or if it would even apply to me...here's my scenario...

I was hosted on GoDaddy, just last week, I switched over to SiteGround. Ever since, I've had this issue. I'm running 2.0.10. I did not have cpanel while on GoDaddy but I do in SiteGround.

Any help would be appreciated.

Thank you!
Owner - Aries Games & Miniatures

Steve

Yea, please start a new thread considering the age of this one and that it's marked solved. :)
DO NOT pm me for support!

Dragon41673

Quote from: Steve on May 25, 2015, 02:21:00 PM
Yea, please start a new thread considering the age of this one and that it's marked solved. :)

Will do!
Owner - Aries Games & Miniatures

Shambles

Quote from: Steve
Yea, please start a new thread considering the age of this one and that it's marked solved. :)

Not actually necessary these days - there's a precedent...

http://www.simplemachines.org/community/index.php?topic=532800.msg3802654#msg3802654

Dragon41673

It's alright Shambles...new thread was started. Clicking unnotify for this one.
Owner - Aries Games & Miniatures

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: