The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
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 * 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 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: 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? 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? 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! |