The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
MySQL Error - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: MySQL Error (/showthread.php?tid=105)



MySQL Error - 1PUTTS - Apr 4th, 2009

Version:
v2.0.0-beta-20090402

Error Message:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in path_to_form_tools_2/global/code/hooks.php on line 128

Also:
Warning: Cannot modify header information - headers already sent by (output started at path_to_form_tools_2/global/code/hooks.php:128) in path_to_form_tools_2/form_tools_2/global/code/accounts.php on line 143

PHP Version: 5
MySQL version: 5.0.24a

Here's line 128 of hooks.php:
Code:
while ($row = mysql_fetch_assoc($query))

Any hints?


RE: MySQL Error - Ben - Apr 4th, 2009

Hmm... this is worrying. It sounds like there may have been a problem when you last upgraded. Are you running the latest version of the script? Did you upgrade recently?

Let's just do a quick bit of debugging. Could you add this code on line 126 and post the result that you get when you reload the webpage?

PHP Code:
echo "SELECT *
    FROM   
{$g_table_prefix}hooks
    WHERE  hook_type = '
$hook_type' AND
           action_location = '
$event' AND
           core_function = '
$core_function'
    ORDER BY priority ASC"


Thanks!


RE: MySQL Error - Ben - Apr 4th, 2009

Damn. Ignore my previous post.

Again, do you have phpMyAdmin access? If so, run the following 3 statements:

Code:
ALTER TABLE {$g_table_prefix}hooks ADD hook_type ENUM('code', 'template') NOT NULL DEFAULT 'code' AFTER hook_id

ALTER TABLE {$g_table_prefix}hooks CHANGE action_location action_location VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

ALTER TABLE {$g_table_prefix}account_settings CHANGE setting_value setting_value MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

You'll need to replace {$g_table_prefix} with whatever database table prefix you chose.

Sorry about this. There's a bug in the installation script. I'll release a new version shortly.

- Ben


RE: MySQL Error - 1PUTTS - Apr 4th, 2009

(Apr 4th, 2009, 2:12 PM)Ben Wrote:
Code:
ALTER TABLE {$g_table_prefix}hooks ADD hook_type ENUM('code', 'template') NOT NULL DEFAULT 'code' AFTER hook_id

ALTER TABLE {$g_table_prefix}hooks CHANGE action_location action_location VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

ALTER TABLE {$g_table_prefix}account_settings CHANGE setting_value setting_value MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

You'll need to replace {$g_table_prefix} with whatever database table prefix you chose.

Sorry about this. There's a bug in the installation script. I'll release a new version shortly.

- Ben

Thanks Ben but I get a Syntax Error when I try to run the SQL statements. I replaced {$g_table_prefix} with ft_ such that the statement reads:

Code:
ALTER TABLE ft_hooks ADD hook_type ENUM('code', 'template') NOT NULL DEFAULT 'code' AFTER hook_id

My host is running phpMyAdmin 2.4.0 if that makes a difference. I tried to alter the tables manually but it didn't work.


RE: MySQL Error - Ben - Apr 4th, 2009

Do you mean you were unable to alter the tables or the modifications didn't solve the problem?

- Ben


RE: MySQL Error - 1PUTTS - Apr 4th, 2009

(Apr 4th, 2009, 3:21 PM)Ben Wrote: Do you mean you were unable to alter the tables or the modifications didn't solve the problem?

- Ben

I'm able to modify the tables but not to the extent that your SQL statements dictated. Maybe my version of phpMyAdmin is limited? I'm not sure. But, for example, I couldn't see how to alter ft_action_location to include all the utf8 stuff. I changed it to VARCHAR (100) but that's as far as I got.

I did figure out how to add the ('code', 'template') to the ENUM on the ft_hook_type table just by reading a little bit of SQL documentation.

So I guess the answer is, I sort of half-assed changed the tables but not as much as I needed to. I'll give it another whirl after dinner. Thanks again...
(Apr 4th, 2009, 3:21 PM)Ben Wrote: Do you mean you were unable to alter the tables or the modifications didn't solve the problem?

- Ben

I forgot to add that adding the ft_hook_type ENUM('code', 'template') did get rid of the error message. But I haven't done anything further with the FormTools2 Beta to see if I've screwed anything up in my attempt to alter those other tables...


RE: MySQL Error - Ben - Apr 9th, 2009

Did you manage to sort through this problem?

If not, I'd triple-check your database structure. Download the main zipfile and compare the database structure outlined in /install/files/sql.php with your own database.

Just an idea!