Missing "posts_approved" in database?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
hbrige55
Registered User
Posts: 6
Joined: Thu Jun 20, 2013 4:16 am

Missing "posts_approved" in database?

Post by hbrige55 »

I'm trying to debug a Pearl script that checks for posts in the moderation queue. It seems to be failing after not finding a field called "post_approved" which doesn't seem to exist in my phpbb3_posts field


Here's the relevant section of the script (I think).
# Check for Posts Needing Approval
$report_index = 0;
@col_titles[$report_index] = "Posts";
# Create a query of the data base.
$sql = "SELECT `poster_id`, `post_subject`, `post_text` FROM `phpbb_posts` WHERE post_approved=0";
# Give the data base a chance to prepare. Perhaps it will compile the request.
$sth = $dbh->prepare($sql);
# Run the query.
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";
while (@row=$sth->fetchrow_array) {
$post_approval_count++;
$sql = "SELECT `username` FROM `phpbb_users` WHERE user_id=$row[0]";
$sth2 = $dbh->prepare($sql);
$sth2->execute || die "Could not execute SQL statement ... maybe invalid?";


here's the error message from the Pearl script

DBD::mysql::st execute failed: Unknown column 'post_approved' in 'where clause' at /home/modernde/moderation/moderator.pl line 42.
Could not execute SQL statement ... maybe invalid? at /home/modernde/moderation/moderator.pl line 42.

I ran the database upgrader when doing the manual php3.2 upgrade. It said that it completed successfully but maybe it just skipped over the field for some reason. don't really know if there is a log file I could check.

All ideas welcome.
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Missing "posts_approved" in database?

Post by AlfredoRamos »

That cloumn does not exist in the *_posts column in a default installation.

Edit: That column was removed in phpBB v3.1.0

https://github.com/phpbb/phpbb/blob/3.1 ... ete_p2.php
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Missing "posts_approved" in database?

Post by 3Di »

change
WHERE post_approved = 0

to be
WHERE post_visibility = 0

should do.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
hbrige55
Registered User
Posts: 6
Joined: Thu Jun 20, 2013 4:16 am

Re: Missing "posts_approved" in database?

Post by hbrige55 »

Thank you so much,

Paul
Post Reply

Return to “[3.2.x] Support Forum”