Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2014, 03:39 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with a Mysqi problem using a mod

Before someone says "Go post in the thread that the original mod is in for help..." please note that the member who created the mod I'm about to post about has not been online since October 4 and their PM box is full as well as they are obviously not providing support for their mod.

The server has been recently upgraded from PHP 5.3 to PHP 5.4.33 and we are running vBulletin 4.2.2 P1. We are also running MySQL 5.5.37 if that helps any.

I'm using a mod called Easy Forms, some of you maybe familiar with it. Its found here: https://vborg.vbsupport.ru/showthrea...34385&page=128

I'm getting this error now when I try to view the form. This happens whenever I click on the button to view the form that I have created. Here is the error.

Code:
Fatal error: Cannot use object of type mysqli_result as array in /home/public_html/forum/forms.php on line 1242
The code that is contained on that line is:

Code:
$formbit['value'] = $q[$formbit[id]];
I am posting the results of the form to a forum id. Please help me fix this as its a very important part of the site.
Reply With Quote
  #2  
Old 10-23-2014, 04:19 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just as an experiment try doing it this way

Code:
$id = $forumbit[$id];
$forumbit['value'] = $q[$id];
Reply With Quote
Благодарность от:
Max Taxable
  #3  
Old 10-23-2014, 03:22 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
Just as an experiment try doing it this way

Code:
$id = $forumbit[$id];
$forumbit['value'] = $q[$id];
Thanks that did not work
Reply With Quote
  #4  
Old 10-23-2014, 03:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would guess it is some code above that actual line. Since I don't know the mod at all (which is why we tell you to post in the thread), then I can't say what the actual problem is. If you google the error, you'll get things like this that may help - http://stackoverflow.com/questions/1...-mysqli-result
Reply With Quote
  #5  
Old 10-23-2014, 10:08 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I would guess it is some code above that actual line. Since I don't know the mod at all (which is why we tell you to post in the thread), then I can't say what the actual problem is. If you google the error, you'll get things like this that may help - http://stackoverflow.com/questions/1...-mysqli-result
No I already tried that. It was no help there is no code like that in the file. I've attached the file.

[File removed]
Reply With Quote
  #6  
Old 10-24-2014, 04:03 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't find that line of code but I think your problem is that the query returns a table , which is not quite the same thing as an array, so you have to run through the table and add values to your array. Perhaps older versions of php allowed you to fudge things a little and pretend the table is an an array but we have to be better coders in this brave new world of php 5x.

So generally you would want to do something like this:

Code:
$php_array = array();

while($results = $vbulletin->db->fetch_array( $query_result ))
{
         // add some query value to the array ....
         $php_array[] = $results[something];
}
Reply With Quote
  #7  
Old 10-24-2014, 08:32 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
I can't find that line of code but I think your problem is that the query returns a table , which is not quite the same thing as an array, so you have to run through the table and add values to your array. Perhaps older versions of php allowed you to fudge things a little and pretend the table is an an array but we have to be better coders in this brave new world of php 5x.

So generally you would want to do something like this:

Code:
$php_array = array();

while($results = $vbulletin->db->fetch_array( $query_result ))
{
         // add some query value to the array ....
         $php_array[] = $results[something];
}
Ok thanks for the info. I'll have to see if I can figure out how to apply that to this.

EDIT: just a bit of more info...If I uninstall the hack and reinstall it fresh and then create a new form it works fine until I add questions to the form. So it must have something to do with the questions being added. Maybe its possible to put those variables into an array?
Reply With Quote
  #8  
Old 10-25-2014, 08:05 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I guess you have four options.

1) Wait for the mod author to fix the issue.
2) Downgrade your PHP version to 5.3.
3) Uninstall/Disable the mod.
4) Pay someone to fix it by posting in the paid requests forum, https://vborg.vbsupport.ru/forumdisplay.php?f=30
Reply With Quote
  #9  
Old 10-25-2014, 10:27 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
Well I guess you have four options.

1) Wait for the mod author to fix the issue.
2) Downgrade your PHP version to 5.3.
3) Uninstall/Disable the mod.
4) Pay someone to fix it by posting in the paid requests forum, https://vborg.vbsupport.ru/forumdisplay.php?f=30
Unfortunately none of those options work for me.
Reply With Quote
  #10  
Old 10-25-2014, 10:28 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well then there is nothing you can do then.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04861 seconds
  • Memory Usage 2,258KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete