supplied resource is not a valid ss_sqlsrv_stmt resource

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
stuie_m
Registered User
Posts: 3
Joined: Tue Nov 28, 2023 2:37 pm

supplied resource is not a valid ss_sqlsrv_stmt resource

Post by stuie_m »

Support Request Template
What version of phpBB are you using? phpBB 3.3.9
What is your board's URL? http://forum.nqican.org.uk/
Who do you host your board with? Formic
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
Do you have any extensions installed? No
What version of phpBB3 did you update from? phpBB 3.3.9
What styles do you currently have installed? Flat Style by Ian Bradley
What language(s) is your board currently using? English
Which database type/version are you using? Firebird
What is your level of experience? New to PHP and phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? Didn't make any changes
Please describe your problem. [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mssqlnative.php on line 255: sqlsrv_fetch_array(): supplied resource is not a valid ss_sqlsrv_stmt resource
Generated by SRT Generator
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10565
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster

Re: supplied resource is not a valid ss_sqlsrv_stmt resource

Post by Noxwizard »

The error message indicates that your database is MSSQL and not Firebird as your SRT says. The line number in the error message doesn't match up with 3.3.9 though. In the ACP what version of phpBB and PHP does it say you're running? I suspect your host updated the PHP version.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
stuie_m
Registered User
Posts: 3
Joined: Tue Nov 28, 2023 2:37 pm

Re: supplied resource is not a valid ss_sqlsrv_stmt resource

Post by stuie_m »

Sorry, yes it is SQL server, and not firebird. I must have accidently selected that.

I can't login I get a raft of errors,

Code: Select all

General Error

SQL ERROR [ mssqlnative ]

SQLSTATE: 23000 code: 2601 message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'dbo.phpbb_notification_types' with unique index 'type'. The duplicate key value is (notification.type.admin_activate_user). SQLSTATE: 01000 code: 3621 message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The statement has been terminated. [3621]

SQL

INSERT INTO phpbb_notification_types (notification_type_name, notification_type_enabled) VALUES ('notification.type.admin_activate_user', 1)

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 1023
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mssqlnative.php
LINE: 143
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 345
CALL: phpbb\db\driver\mssqlnative->sql_query()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 969
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/phpbb/notification/type/base.php
LINE: 109
CALL: phpbb\notification\manager->get_notification_type_id()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 934
CALL: phpbb\notification\type\base->set_notification_manager()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 904
CALL: phpbb\notification\manager->load_object()

FILE: [ROOT]/phpbb/notification/method/board.php
LINE: 229
CALL: phpbb\notification\manager->get_item_type_class()

FILE: [ROOT]/phpbb/notification/manager.php
LINE: 123
CALL: phpbb\notification\method\board->load_notifications()

FILE: [ROOT]/includes/functions.php
LINE: 3942
CALL: phpbb\notification\manager->load_notifications()

FILE: [ROOT]/index.php
LINE: 247
CALL: page_header()
Version wise:
C:\Users\stu>php -v
PHP 7.1.29 (cli) (built: May 1 2019 14:01:34) ( NTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies[/size]

From the Style.cfg:

Code: Select all

#
# phpBB Style Configuration File
#
# This file is part of the phpBB Forum Software package.
#
# @copyright (c) phpBB Limited <https://www.phpbb.com>
# @license GNU General Public License, version 2 (GPL-2.0)
#
# For full copyright and license information, please see
# the docs/CREDITS.txt file.
#
# At the left is the name, please do not change this
# At the right the value is entered
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
# Single and double quotes do not need to be escaped.
#
#

# General Information about this style
name = prosilver
copyright = © phpBB Limited, 2007
style_version = 3.3.9
phpbb_version = 3.3.9

# Defining a different template bitfield
# template_bitfield = //g=

# Parent style
# Set value to empty or to this style's name if this style does not have a parent style
parent = prosilver
Last edited by Mick on Wed Nov 29, 2023 9:17 am, edited 1 time in total.
Reason: Code tags added for clarity.
stuie_m
Registered User
Posts: 3
Joined: Tue Nov 28, 2023 2:37 pm

Re: supplied resource is not a valid ss_sqlsrv_stmt resource

Post by stuie_m »

I installed a fresh version of 3.3.11, pointed the DB at it, and the error disappeared. So I think it must have had something to do with corrupt files somewhere, maybe the cache. I've no idea really, jus a hunch.

When I looked at the existing version, it appears the versions were all over the place, it said it was v3.3.9, but when I tried to install the advanced patch to upgrade to 3.3.11, is said it was actually 3.2.1?! So I downloaded the 3.2.1 to 3.3.11 advanced patch and it upgraded and seems to be working.
User avatar
warmweer
Jr. Extension Validator
Posts: 11374
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: supplied resource is not a valid ss_sqlsrv_stmt resource

Post by warmweer »

Still seeing

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mssqlnative.php on line 255: sqlsrv_fetch_array(): supplied resource is not a valid ss_sqlsrv_stmt resource
Why use the advanced update anyway?

a) A full update would have covered all situations
b) The point of the Advanced Update is to keep any modifications working on the version you're updating from, but it seems you're coming from 3.2.1. There's no guarantee at all that those code edits are still functional a major version (and 10 minor versions) later.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.

Return to “[3.3.x] Support Forum”